From: Warren Young Date: May 3 2010 2:02pm Subject: Re: DateTime issue List-Archive: http://lists.mysql.com/plusplus/8937 Message-Id: <4BDED78C.4040900@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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.