List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:May 3 2010 2:02pm
Subject:Re: DateTime issue
View as plain text  
On 5/3/2010 6:13 AM, Pierre-Etienne DELON wrote:
>
> Here is my code :

Please keep replies on the list.

> time_t tm = (time_t) stamp;

This is using localtime(), as I said.  I would guess that the column 
data is coming from the DB as GMT, so you're getting that offset.

The conversion of SQL string data to DateTime is lossless.  The 
conversion from DateTime to time_t is not lossless, and contains the 
"local time" assumption.  There is no way around this, other than 
writing your own conversion.  If you do that, I would suggest making it 
an extension to DateTime, such as a from_utc() method, returning time_t. 
  Then future versions of MySQL++ will have this conversion built-in.
Thread
DateTime issuePierre-Etienne DELON3 May
  • Re: DateTime issueWarren Young3 May
Re: DateTime issueWarren Young3 May