On Mon, Aug 24, 2009 at 06:21:49PM -0400, Wilson, Ronald scratched on the wall:
> According to the documentation for CURRENT_TIMESTAMP, it should insert
> the current UTC date/time:  http://www.sqlite.org/lang_createtable.html.

> sqlite> select datetime('now', 'utc');
> 
> 2009-08-25 02:20:10

> Do I misunderstand something fundamental?


  Yes.  'now' is already in UTC, so there is no need to convert it.
  The syntax datetime('now', 'utc') is double-converting the time.
  
  The documentation for the 'utc' modifier is quite clear:

  "'utc' assumes that the string to its left is in the local timezone
  and adjusts that string to be in UTC. If the prior string is not in
  localtime, then the result of 'utc' is undefined."

  http://www.sqlite.org/lang_datefunc.html


    -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to