Eric Minbiole wrote:
> Sebastien Robillard wrote:
>
>> Hi everyone,
>> I have an issue with datetimes that doesn't return the "time" part
>> correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++
>> code. Whenever I use datetime('now'), or current_timestamp, the time is
>> not correct. However, it works correctly when using the sqlite3 program
>> (sqlite-3_5_9.zip from download page). Right now I use the SQLite dll
>> (sqlitedll-3_5_9.zip) in my code, but I also tried with the source code
>> amalgamation with the same results <sqlitedll-3_5_9.zip>
>>
>
> Your code looked correct, so I tried to reproduce the problem: I
> complied the sample code you provided using Visual Studio 2005 and the
> v3.5.9 amalgamation. Running under XP, I got the expected result:
>
> DATETIME('NOW') = 2008-07-14 18:29:49
>
> I assume that you are running under some flavor of Windows, since you
> are using sqlitedll. Perhaps start by adding some traces to SQLite
> function "winCurrentTime()"?
>
> Good luck,
> Eric
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
What I omit to tell earlier is that I use SQLite to save some data for a
game. After tracing my code a bit more, and after checking the
winCurrentTime function as you proposed, I realized that the problem
occurs only AFTER the creation of my Direct3D 9 device. Before that
point, the dates works correctly. Once my device is created, the
numbers goes all wrong. I traced the winCurrentTime function and saw
that there is errors in calculations. For exemple, this line
*prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
gives me these numbers
*prNow = 148848.828125 + 2305813.5;
The result inside prNow is 2454662.25
Once again, all of these problems doesn't happen before the creation of
the Direct3D device. Does anyone ever used SQLite successfully in a
full-screen 3D game ?
Thanks for your help,
- Sebastien R.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users