1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Make the sqliteOsCurrentTime() function work for Windows. Code contributed

by "e4liberty" on the mailing list. (CVS 1071)

FossilOrigin-Name: 02fac304c9ec9012f3cc4f04d2c4cac5e37b0024
This commit is contained in:
drh
2003-08-10 16:16:22 +00:00
parent 87adaa9a99
commit 41a8230fef
3 changed files with 19 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
C tighter\scoding\sof\sthe\sdate\sand\stime\sfunctions.\s\sBetter\scomments.\s\sA\sbug\sfix.\s(CVS\s1070)
D 2003-08-10T01:50:55
C Make\sthe\ssqliteOsCurrentTime()\sfunction\swork\sfor\sWindows.\s\sCode\scontributed\nby\s"e4liberty"\son\sthe\smailing\slist.\s(CVS\s1071)
D 2003-08-10T16:16:22
F Makefile.in 9ad23ed4ca97f9670c4496432e3fbd4b3760ebde
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -35,7 +35,7 @@ F src/hash.h cd0433998bc1a3759d244e1637fe5a3c13b53bf8
F src/insert.c dc200ae04a36bd36e575272a069e20c528b7fbdf
F src/main.c 2500392bad5629b6d70b06ac5a076958acb49b92
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
F src/os.c acb42a6524adb04cf4b98dd130f1f64657180bba
F src/os.c 97df440bc71f65e22df5d3d920ce39551c0a5f5a
F src/os.h 4c51809f56daf21efbe26fc932998e865a5bc211
F src/pager.c a4fd3a61d63879365f775875edfffaa8c6f3d7f8
F src/pager.h 5da62c83443f26b1792cfd72c96c422f91aadd31
@@ -168,7 +168,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3
F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
P a6197e2075fdf9db862484255ac16b2855bbef0a
R 2c17b8788ba63ebf744e79cd8d1dc806
P 94243edac14b90ef898093b85e1959c20fa23ae9
R d06ee94e7e293f14bb7a17592af45795
U drh
Z 001852bd03c4d150dde8de11d7257985
Z c133f327a7247010c46dbc5ed1b64175

View File

@@ -1 +1 @@
94243edac14b90ef898093b85e1959c20fa23ae9
02fac304c9ec9012f3cc4f04d2c4cac5e37b0024

View File

@@ -1610,5 +1610,17 @@ int sqliteOsCurrentTime(double *prNow){
*prNow = t/86400.0 + 2440587.5;
return 0;
#endif
#if OS_WIN
FILETIME ft;
/* FILETIME structure is a 64-bit value representing the number of
100-nanosecond intervals since January 1, 1601 (= JD 2305813.5).
*/
double now;
GetSystemTimeAsFileTime( &ft );
now = ((double)ft.dwHighDateTime) * 4294967296.0;
*prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
#endif
return 0;
return 1;
}