summaryrefslogtreecommitdiff
path: root/src/include/utils/nabstime.h
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1997-04-02 18:36:24 +0000
committerMarc G. Fournier <scrappy@hub.org>1997-04-02 18:36:24 +0000
commit2ab34dfe1a7c2fecf158a4e5e042c3f971a46ab0 (patch)
tree242770c813c27be51c734da1a057510e620f8014 /src/include/utils/nabstime.h
parent920c58df71f2dd02b0221dd89e0b7dfc57f8c778 (diff)
downloadpostgresql-2ab34dfe1a7c2fecf158a4e5e042c3f971a46ab0.tar.gz
From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] More date time functions Here are some additional patches mostly related to the date and time data types. It includes some type conversion routines to move between the different date types and some other date manipulation routines such as date_part(units,datetime). I noticed Edmund Mergl et al's neat trick for getting function overloading for builtin functions, so started to use that for the date and time stuff. Later, if someone figures out how to get function overloading directly for internal C code, then we can move to that technique. These patches include documentation updates (don't faint!) for the built-in man page. Doesn't yet include mention of timestamp, since I don't know much about it and since it may change a bit to become a _real_ ANSI timestamp which would include parser support for the declaration syntax (what do you think, Dan?). The patches were developed on the 970330 release, but have been rebuilt off of the 970402 release. The first patch below is to get libpq to compile, on my Linux box, but is not related to the rest of the patches and you can choose not to apply that one at this time. Thanks in advance, scrappy!
Diffstat (limited to 'src/include/utils/nabstime.h')
-rw-r--r--src/include/utils/nabstime.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h
index e8691f7273..400bb045c5 100644
--- a/src/include/utils/nabstime.h
+++ b/src/include/utils/nabstime.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nabstime.h,v 1.6 1997/03/25 08:11:24 scrappy Exp $
+ * $Id: nabstime.h,v 1.7 1997/04/02 18:32:39 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -84,17 +84,8 @@ typedef TimeIntervalData *TimeInterval;
#define RelativeTimeIsValid(time) \
((bool) (((RelativeTime) time) != INVALID_RELTIME))
-#if USE_NEW_TIME_CODE
-
extern AbsoluteTime GetCurrentAbsoluteTime(void);
-#else
-
-#define GetCurrentAbsoluteTime() \
- ((AbsoluteTime) getSystemTime())
-
-#endif
-
/*
* getSystemTime --
* Returns system time.
@@ -121,11 +112,17 @@ extern bool abstimelt(AbsoluteTime t1, AbsoluteTime t2);
extern bool abstimegt(AbsoluteTime t1, AbsoluteTime t2);
extern bool abstimele(AbsoluteTime t1, AbsoluteTime t2);
extern bool abstimege(AbsoluteTime t1, AbsoluteTime t2);
+extern bool abstime_finite(AbsoluteTime time);
extern AbsoluteTime datetime_abstime(DateTime *datetime);
+extern DateTime *abstime_datetime(AbsoluteTime abstime);
extern bool AbsoluteTimeIsBefore(AbsoluteTime time1, AbsoluteTime time2);
extern bool AbsoluteTimeIsAfter(AbsoluteTime time1, AbsoluteTime time2);
+
+extern AbsoluteTime tm2abstime(struct tm *tm, int tz);
+extern void abstime2tm(AbsoluteTime time, int *tzp, struct tm *tm);
+
extern AbsoluteTime dateconv(struct tm *tm, int zone);
extern time_t qmktime(struct tm *tp);