As designed Email templates use wrong time zone information

Jon W

Well-known member
If dates/times are included in email templates, then this can result in some very strange results due to the wrong time zone information being used.

For a really obvious example, add the following to the top of the email template watched_thread_reply_messagetext (or watched_thread_reply as appropriate)
HTML:
{xen:datetime $reply.reply_date, 'absolute'}

Set a user (user A) to watch a thread. Get another user (user B, in a different timezone) to respond to that thread.

User A will receive an email, but the reply date will be in the timezone of user B.
 
The function always uses the time of the visitor. Nothing changes based on who the email is sent to other than the language (and only if opting into that). As such, this is roughly expected. You would need to resolve this in your code.
 
Top Bottom