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:
15
src/os.c
15
src/os.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user