diff options
Diffstat (limited to 'contrib/datetime/datetime_functions.c')
-rw-r--r-- | contrib/datetime/datetime_functions.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/datetime/datetime_functions.c b/contrib/datetime/datetime_functions.c index 910647118a..c5b8bc25e9 100644 --- a/contrib/datetime/datetime_functions.c +++ b/contrib/datetime/datetime_functions.c @@ -5,6 +5,8 @@ * * Copyright (C) 1999, Massimo Dal Zotto <[email protected]> * + * Date2mjd code contributed by Reiner Dassing <[email protected]> + * * This software is distributed under the GNU General Public License * either version 2, or (at your option) any later version. */ @@ -73,7 +75,7 @@ decode_24h_time(char *str, struct tm *tm, double *fsec) if ( (tm->tm_hour < 0) || (tm->tm_hour > 24) || (tm->tm_min < 0) || (tm->tm_min > 59) || (tm->tm_sec < 0) || (tm->tm_sec > 59) - || (fsec < 0) ) + || (*fsec < 0) ) return -1; return 0; @@ -260,6 +262,16 @@ currentdate() return (date); } +int4 +date2mjd(DateADT val) +{ + int result; + + result = val + JDATE_2000 - 2400000.5; + + return result; +} + /* end of file */ /* |