Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* timestamp.h
|
|
|
|
* Definitions for the SQL92 "timestamp" and "interval" types.
|
|
|
|
*
|
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2001-01-23 04:10:25 +01:00
|
|
|
* $Id: timestamp.h,v 1.13 2001/01/23 03:10:25 momjian Exp $
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef TIMESTAMP_H
|
|
|
|
#define TIMESTAMP_H
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <limits.h>
|
2000-06-15 02:52:26 +02:00
|
|
|
#include <float.h>
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
|
2000-06-09 03:11:16 +02:00
|
|
|
#include "fmgr.h"
|
|
|
|
|
|
|
|
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
/*
|
|
|
|
* Timestamp represents absolute time.
|
|
|
|
* Interval represents delta time. Keep track of months (and years)
|
|
|
|
* separately since the elapsed time spanned is unknown until instantiated
|
|
|
|
* relative to an absolute time.
|
|
|
|
*
|
|
|
|
* Note that Postgres uses "time interval" to mean a bounded interval,
|
|
|
|
* consisting of a beginning and ending time, not a time span - thomas 97/03/20
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef double Timestamp;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2000-11-06 17:05:25 +01:00
|
|
|
double time; /* all time units other than months and years */
|
2001-01-23 04:10:25 +01:00
|
|
|
int32 month; /* months and years, after time for alignment */
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
} Interval;
|
|
|
|
|
|
|
|
|
2000-06-09 03:11:16 +02:00
|
|
|
/*
|
|
|
|
* Macros for fmgr-callable functions.
|
|
|
|
*
|
|
|
|
* For Timestamp, we make use of the same support routines as for float8.
|
|
|
|
* Therefore Timestamp is pass-by-reference if and only if float8 is!
|
|
|
|
*/
|
|
|
|
#define DatumGetTimestamp(X) ((Timestamp) DatumGetFloat8(X))
|
|
|
|
#define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X))
|
|
|
|
|
|
|
|
#define TimestampGetDatum(X) Float8GetDatum(X)
|
|
|
|
#define IntervalPGetDatum(X) PointerGetDatum(X)
|
|
|
|
|
|
|
|
#define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n))
|
|
|
|
#define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n))
|
|
|
|
|
|
|
|
#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
|
|
|
|
#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
|
|
|
|
|
|
|
|
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#ifdef NAN
|
|
|
|
#define DT_INVALID (NAN)
|
|
|
|
#else
|
|
|
|
#define DT_INVALID (DBL_MIN+DBL_MIN)
|
|
|
|
#endif
|
|
|
|
#ifdef HUGE_VAL
|
|
|
|
#define DT_NOBEGIN (-HUGE_VAL)
|
|
|
|
#define DT_NOEND (HUGE_VAL)
|
|
|
|
#else
|
|
|
|
#define DT_NOBEGIN (-DBL_MAX)
|
|
|
|
#define DT_NOEND (DBL_MAX)
|
|
|
|
#endif
|
|
|
|
#define DT_CURRENT (DBL_MIN)
|
|
|
|
#define DT_EPOCH (-DBL_MIN)
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_INVALID(j) do {j = DT_INVALID;} while (0)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#ifdef NAN
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_IS_INVALID(j) (isnan(j))
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#else
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_IS_INVALID(j) (j == DT_INVALID)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#endif
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0)
|
|
|
|
#define TIMESTAMP_IS_NOBEGIN(j) (j == DT_NOBEGIN)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_NOEND(j) do {j = DT_NOEND;} while (0)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#define TIMESTAMP_IS_NOEND(j) (j == DT_NOEND)
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_CURRENT(j) do {j = DT_CURRENT;} while (0)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#if defined(linux) && defined(__powerpc__)
|
|
|
|
extern int timestamp_is_current(double j);
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_IS_CURRENT(j) timestamp_is_current(j)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#else
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_IS_CURRENT(j) (j == DT_CURRENT)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#endif
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_EPOCH(j) do {j = DT_EPOCH;} while (0)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#if defined(linux) && defined(__powerpc__)
|
|
|
|
extern int timestamp_is_epoch(double j);
|
|
|
|
|
|
|
|
#define TIMESTAMP_IS_EPOCH(j) timestamp_is_epoch(j)
|
|
|
|
#else
|
|
|
|
#define TIMESTAMP_IS_EPOCH(j) (j == DT_EPOCH)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define TIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j))
|
2000-04-12 19:17:23 +02:00
|
|
|
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
|| TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
|
|
|
|
#define TIMESTAMP_IS_RESERVED(j) (TIMESTAMP_IS_RELATIVE(j) || TIMESTAMP_NOT_FINITE(j))
|
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
#define INTERVAL_INVALID(j) do {(j).time = DT_INVALID;} while (0)
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#ifdef NAN
|
|
|
|
#define INTERVAL_IS_INVALID(j) (isnan((j).time))
|
|
|
|
#else
|
|
|
|
#define INTERVAL_IS_INVALID(j) ((j).time == DT_INVALID)
|
|
|
|
#endif
|
|
|
|
#define INTERVAL_NOT_FINITE(j) INTERVAL_IS_INVALID(j)
|
|
|
|
|
|
|
|
#define TIME_PREC_INV 1000000.0
|
|
|
|
#define JROUND(j) (rint(((double) (j))*TIME_PREC_INV)/TIME_PREC_INV)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* timestamp.c prototypes
|
|
|
|
*/
|
|
|
|
|
2000-06-09 03:11:16 +02:00
|
|
|
extern Datum timestamp_in(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_out(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_eq(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_ne(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_lt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_le(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_ge(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_gt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_finite(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_cmp(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_smaller(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_larger(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
extern Datum interval_in(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_out(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_eq(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_ne(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_lt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_le(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_ge(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_gt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_finite(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_cmp(PG_FUNCTION_ARGS);
|
2000-06-19 05:55:01 +02:00
|
|
|
extern Datum interval_hash(PG_FUNCTION_ARGS);
|
2000-06-09 03:11:16 +02:00
|
|
|
extern Datum interval_smaller(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_larger(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
extern Datum timestamp_text(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum text_timestamp(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_text(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum text_interval(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_trunc(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_trunc(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_part(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_part(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_zone(PG_FUNCTION_ARGS);
|
2000-11-06 17:05:25 +01:00
|
|
|
extern Datum timestamp_izone(PG_FUNCTION_ARGS);
|
2000-06-09 03:11:16 +02:00
|
|
|
|
|
|
|
extern Datum interval_um(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_pl(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_mi(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_mul(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum mul_d_interval(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_div(PG_FUNCTION_ARGS);
|
2000-07-17 05:05:41 +02:00
|
|
|
extern Datum interval_accum(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum interval_avg(PG_FUNCTION_ARGS);
|
2000-06-09 03:11:16 +02:00
|
|
|
|
|
|
|
extern Datum timestamp_mi(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_pl_span(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_mi_span(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum timestamp_age(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum overlaps_timestamp(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
extern Datum now(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
/* Internal routines (not fmgr-callable) */
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
extern int tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *dt);
|
2000-06-09 03:11:16 +02:00
|
|
|
extern int timestamp2tm(Timestamp dt, int *tzp, struct tm * tm,
|
|
|
|
double *fsec, char **tzn);
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
|
|
|
|
extern Timestamp SetTimestamp(Timestamp timestamp);
|
|
|
|
|
2000-08-29 06:41:48 +02:00
|
|
|
extern void isoweek2date( int woy, int *year, int *mon, int *mday);
|
|
|
|
extern int date2isoweek(int year, int mon, int mday);
|
|
|
|
|
Implement "date/time grand unification".
Transform datetime and timespan into timestamp and interval.
Deprecate datetime and timespan, though translate to new types in gram.y.
Transform all datetime and timespan catalog entries into new types.
Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
routines for all date/time types.
date.{h,c} now deals with date, time types.
timestamp.{h,c} now deals with timestamp, interval types.
nabstime.{h,c} now deals with abstime, reltime, tinterval types.
Make NUMERIC a known native type for purposes of type coersion. Not tested.
2000-02-16 18:26:26 +01:00
|
|
|
#endif /* TIMESTAMP_H */
|