Re: questions about timestamps and DST
- Date: Tue, 31 Mar 2015 06:13:42 +0100
- From: Andrew Moore <eroomydna@xxxxxxxxx>
- Subject: Re: questions about timestamps and DST
When you use a timezone with DST there is no such thing as 2.30am on the
date of changeover. That hour doesn't exist.
Look up the difference between timestamp and datetime data types.
On 31 Mar 2015 05:43, "Larry Martell" <larry.martell@xxxxxxxxx> wrote:
> I have a column that was a timestamp type. I was inserting rows using
> NOW(). When we switched to DST and the hour from 2am to 3am was
> non-existent I of course had no data for that hour. For reasons I
> don't need to go into, that missing hour caused problems downstream.
> To prevent this from happening next year I changed the insert to use
> UTC_TIMESTAMP() and I wanted to fill in data for that missing hour.
> But no matter what I do it will not let me insert values for that hour
> - it gives me an 'Invalid TIMESTAMP value' warning" and inserts a row
> with a time of 3:00 for any time in that hour I give. This makes me
> think that I have not actually solved the problem for next year (I
> can't test this to know).
> So my questions are:
> 1) How can I actually insert a timestamp value that will not be
> affected by the time change and not have the missing hour?
> 2) Why is it not allowing me to insert UTC times for that missing
> hour? How can I insert UTC values for that missing hour?
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql