New answers tagged


I believe DATETIME instead of TIMESTAMP does exactly what you are asking for, if I understood it correctly: CREATE TABLE `foo` (`ts` DATETIME DEFAULT '1970-01-01 00:00:01');


EDIT after clarification: I'm afraid you can't deal with it the way you intend. You have to find another way, like for example defaulting to NULL and selecting via SELECT COALESCE(ts, CONVERT_TZ( '1970-01-01 00:00:01', '+00.00', @@session.time_zone)) AS ts, ... Or just use datetime and store the time_zone in a separate column. It depends on your ...

Top 50 recent answers are included