Timestamps awry with daylight savings time
Timestamps awry with daylight savings time
- Subject: Timestamps awry with daylight savings time
- From: Drew Thoeni <email@hidden>
- Date: Sun, 3 Apr 2005 08:29:48 -0400
So this morning I wake up to daylight savings time here in the east coast of the US. And just like clockwork, my application no longer allows login. This, it turns out, is due to me having "TIMESTAMP WITH TIME ZONE" in my EOModel for external types in Frontbase.
Reviewing the SQL log from WO, the update statement I execute when a new user has logged in includes all the fields in the where clause (as expected). And WO has read the time correctly from the database but is changing the timezone on the fly. That is the timezone recorded in the database is -5:00 (recorded prior to DST) but the timezone WO sends in the SQL where clause is -4:00.
Example (shortened where clause)
UPDATE "T_USER"
SET "C_LAST_LOG_IN" = TIMESTAMP '2005-04-03 07:15:43.370-04:00',
"C_TIMES_LOGGED_IN" = 44
WHERE (
"C_USER_NUMBER" = 2723 AND
"C_ADMIN_LEVEL" = 1 AND
"C_SHORT_NAME" = 'alexs' AND
"C_SUFFIX" is NULL AND
"C_MEMBER_SINCE_DATE" = TIMESTAMP '2005-02-04 22:47:40.000-04:00' ); <----- problem
You can see the memberSinceDate is in February, which WO got from the database and didn't change. But the database actually has -5:00 as it's timezone for this column. But WO has changed the outgoing WHERE clause to today's correct timezone (-4:00). This, of course, has the effect of not finding a row to update, as the timestamps don't match.
How is this best handled? Not keeping timezones in the database? Not using these columns for update checking?
Regards,
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden