I'm querying a SQL database with DatabaseLink and resulting SQLDateTime objects are shifted by an hour during daylight saving time. The dates are stored in the database without a DST shift, so it seems like Mathematica is applying the change. How can I eliminate the spurious shift? A workaround, such as getting AbsoluteTime-style integers instead of SQLDateTime expressions would be fine.
|
|
|||
|
However, the simplest workaround is to change your SQL statements to return dates as strings. This side-steps all of the JDBC date arithmetic nightmare. In most dialects of SQL, this means changing:
to something like
Unfortunately, the exact syntax is not standardized so you will have to look it up for your dialect of SQL. In SQL Server, for example, we have a couple of options:
returns a localized string like
However, we might want to take out the vagaries of localization by converting dates to a fixed format instead. Again, using SQL Server as an example:
returns an ISO-like date string: |
|||
|
$TimeZone? Alternatively, is your OS currently set to DST? – J. M.♦ Feb 7 '12 at 16:57-7.. What does that tell us? – ArgentoSapiens Feb 7 '12 at 17:43