taco-db  0.1.0
Functions
pg_datetime.h File Reference

This file contains date/time utilities adapted from PostgreSQL 14.1 source code. More...

#include "tdb.h"

Go to the source code of this file.

Functions

int date2j (int y, int m, int d)
 date2j() from PostgreSQL utils/adt/datetime.c. More...
 
void j2date (int jd, int *year, int *month, int *day)
 j2date() from PostgreSQL utils/adt/datetime.c. More...
 

Detailed Description

This file contains date/time utilities adapted from PostgreSQL 14.1 source code.

See COPYRIGHT for a copyright notice.

Function Documentation

◆ date2j()

int date2j ( int  y,
int  m,
int  d 
)

date2j() from PostgreSQL utils/adt/datetime.c.

Converts a date (Y-m-d) to a julian day number.

Note that y is the actual year number (not year - 1900); m is from 1 to 12, not from 0.

◆ j2date()

void j2date ( int  jd,
int *  year,
int *  month,
int *  day 
)

j2date() from PostgreSQL utils/adt/datetime.c.

Converts a julian day number to a date (Y-m-d).

Note that y is the actual year number (not year - 1900); m is from 1 to 12, not from 0.