Re: [sqlite] Time calculation bug?

2010-10-19 Thread Stephen Chrzanowski
Just as a follow up, there was a bug in the developers code, and he's
corrected the problem.  He forgot to carry a month. {smirk}

On Mon, Oct 18, 2010 at 6:30 AM, Stephen Chrzanowski wrote:

> Interesting.  I get the same results as you when I use sqlite3.exe, but, in
> a database manager, the result comes back as I reported.  I'll contact the
> developer of the utility and see if he can come up with something.
>
>
> On Mon, Oct 18, 2010 at 5:31 AM, Simon Davies <
> simon.james.dav...@gmail.com> wrote:
>
>> On 18 October 2010 09:28, Stephen Chrzanowski 
>> wrote:
>> > I seem to be having an odd behavioral problem with calculating time
>> stamps.
>> >
>> .
>> .
>> .
>> > For instance:
>> >
>> > select strftime('%s','now') RealUTC,strftime('%s','now','localtime')
>> > LocalTime,
>> >   strftime('%s','now') -   strftime('%s','now','localtime')
>> >
>> > Yeilds results of:
>> > RealUTCLocalTime  strftime('%s','now') -
>> > strftime('%s','now','localtime')
>> > -- --
>> > -
>> > 1287389442 1290053442 -2664000
>>
>> On my windoze7 m/c I set the time zone to Atlantic Time (Canada) (UTC
>> -04:00), and executed your query in sqlite3 shell:
>>
>> SQLite version 3.6.11
>> Enter ".help" for instructions
>> sqlite> select strftime('%s','now')
>> RealUTC,strftime('%s','now','localtime')
>>...> LocalTime,
>>   ...>   strftime('%s','now') -   strftime('%s','now','localtime')
>>...> ;
>> 1287394030|1287379630|14400
>> sqlite>
>>
>> I do not see the problem that you report
>>
>> >
>> > I'm currently sitting in -0400 (EDT) and there should only be a maximum
>> of
>> > 14,400 seconds.  2664000 seems to add up to just under 31 days.
>> >
>> > Now, I'm writing the code that does the database management, and I've
>> > modified it so that when inserting/updating the time, its done with the
>> > date('2010-10-18 04:08:04','utc') to do the conversion, and the math
>> works
>> > without using UTC or LOCALTIME in the strftime functions but I'd still
>> like
>> > to know why the above SQL statement bombs?
>>
>> Regards,
>> Simon
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Time calculation bug?

2010-10-18 Thread Stephen Chrzanowski
Interesting.  I get the same results as you when I use sqlite3.exe, but, in
a database manager, the result comes back as I reported.  I'll contact the
developer of the utility and see if he can come up with something.

On Mon, Oct 18, 2010 at 5:31 AM, Simon Davies
wrote:

> On 18 October 2010 09:28, Stephen Chrzanowski  wrote:
> > I seem to be having an odd behavioral problem with calculating time
> stamps.
> >
> .
> .
> .
> > For instance:
> >
> > select strftime('%s','now') RealUTC,strftime('%s','now','localtime')
> > LocalTime,
> >   strftime('%s','now') -   strftime('%s','now','localtime')
> >
> > Yeilds results of:
> > RealUTCLocalTime  strftime('%s','now') -
> > strftime('%s','now','localtime')
> > -- --
> > -
> > 1287389442 1290053442 -2664000
>
> On my windoze7 m/c I set the time zone to Atlantic Time (Canada) (UTC
> -04:00), and executed your query in sqlite3 shell:
>
> SQLite version 3.6.11
> Enter ".help" for instructions
> sqlite> select strftime('%s','now')
> RealUTC,strftime('%s','now','localtime')
>...> LocalTime,
>   ...>   strftime('%s','now') -   strftime('%s','now','localtime')
>...> ;
> 1287394030|1287379630|14400
> sqlite>
>
> I do not see the problem that you report
>
> >
> > I'm currently sitting in -0400 (EDT) and there should only be a maximum
> of
> > 14,400 seconds.  2664000 seems to add up to just under 31 days.
> >
> > Now, I'm writing the code that does the database management, and I've
> > modified it so that when inserting/updating the time, its done with the
> > date('2010-10-18 04:08:04','utc') to do the conversion, and the math
> works
> > without using UTC or LOCALTIME in the strftime functions but I'd still
> like
> > to know why the above SQL statement bombs?
>
> Regards,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Time calculation bug?

2010-10-18 Thread Simon Davies
On 18 October 2010 09:28, Stephen Chrzanowski  wrote:
> I seem to be having an odd behavioral problem with calculating time stamps.
>
.
.
.
> For instance:
>
> select strftime('%s','now') RealUTC,strftime('%s','now','localtime')
> LocalTime,
>       strftime('%s','now') -       strftime('%s','now','localtime')
>
> Yeilds results of:
> RealUTC    LocalTime  strftime('%s','now') -
> strftime('%s','now','localtime')
> -- --
> -
> 1287389442 1290053442 -2664000

On my windoze7 m/c I set the time zone to Atlantic Time (Canada) (UTC
-04:00), and executed your query in sqlite3 shell:

SQLite version 3.6.11
Enter ".help" for instructions
sqlite> select strftime('%s','now') RealUTC,strftime('%s','now','localtime')
   ...> LocalTime,
   ...>   strftime('%s','now') -   strftime('%s','now','localtime')
   ...> ;
1287394030|1287379630|14400
sqlite>

I do not see the problem that you report

>
> I'm currently sitting in -0400 (EDT) and there should only be a maximum of
> 14,400 seconds.  2664000 seems to add up to just under 31 days.
>
> Now, I'm writing the code that does the database management, and I've
> modified it so that when inserting/updating the time, its done with the
> date('2010-10-18 04:08:04','utc') to do the conversion, and the math works
> without using UTC or LOCALTIME in the strftime functions but I'd still like
> to know why the above SQL statement bombs?

Regards,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Time calculation bug?

2010-10-18 Thread Stephen Chrzanowski
I seem to be having an odd behavioral problem with calculating time stamps.

The software I'm using drops data into a field as a local time stamp (IE:
'2010-10-18 04:08:04.000') which is fine.  However, when trying to pull that
data back out and convert the Sqlite NOW time to local, I'm getting
extremely odd results.

For instance:

select strftime('%s','now') RealUTC,strftime('%s','now','localtime')
LocalTime,
   strftime('%s','now') -   strftime('%s','now','localtime')

Yeilds results of:
RealUTCLocalTime  strftime('%s','now') -
strftime('%s','now','localtime')
-- --
-
1287389442 1290053442 -2664000

I'm currently sitting in -0400 (EDT) and there should only be a maximum of
14,400 seconds.  2664000 seems to add up to just under 31 days.

Now, I'm writing the code that does the database management, and I've
modified it so that when inserting/updating the time, its done with the
date('2010-10-18 04:08:04','utc') to do the conversion, and the math works
without using UTC or LOCALTIME in the strftime functions but I'd still like
to know why the above SQL statement bombs?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users