1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add experimental date and time functions based on julian day number. (CVS 1069)

FossilOrigin-Name: a6197e2075fdf9db862484255ac16b2855bbef0a
This commit is contained in:
drh
2003-08-09 21:32:28 +00:00
parent 37ed48ed2f
commit 771d8c3bae
6 changed files with 349 additions and 12 deletions

View File

@@ -1597,3 +1597,18 @@ char *sqliteOsFullPathname(const char *zRelative){
return zFull;
#endif
}
/*
** Find the current time (in Universal Coordinated Time). Write the
** current time and date as a Julian Day number into *prNow and
** return 0. Return 1 if the time and date cannot be found.
*/
int sqliteOsCurrentTime(double *prNow){
#if OS_UNIX
time_t t;
time(&t);
*prNow = t/86400.0 + 2440587.5;
return 0;
#endif
return 1;
}