Jan 02, 2017 11:38 PM
Hi it seems like I’m getting inconsistent output from the DATETIME_FORMAT()
I have a field with the date type called “res” and it specifies the time as well.
If I refer to that field with the DATETIME_FORMAT() function and try to express the date in a certain format, like MM/DD, the date actually seems to be off by a day when the time is after a certain time. so for example, if the actual data referred to is 01/10 7:00PM, then what’s shown with DATETIME_FORMAT(res, “MM/DD”) is 01/11, which is a day ahead.
The cut-off time seems to be at 4PM, so if the data is 01/10 3:59PM, then the correct expression (01/10) is shown.
Is this a bug? I’ve shared my example below
May 07, 2017 07:05 PM
Same issue here. Using table to record sent emails. The date of the email is advanced a day when I run DATETIME_FORMAT on the data.
May 07, 2017 07:40 PM
You need to use set_timezone function to get what you want.