Developer forum

Forum » Templates » Timezone of Order datetime

Timezone of Order datetime

Thaw Htun Lynn
Reply

HI,

As requested by the users, I've added this line  @GetValue("Ecom:Order.Date") in notification email template and order datetime is displayed in the email. Users are now requesting the datetime to be sent in (-6hrs CET) timezone. Kindly help me how to fix the datetime to a specific time zone in razor email template.

And also, I have a few questions regarding the time zone.

1. Which timezone is used when saving the order record in the database.

2. WIll the datetime change according to the user's time zone by login user or by website?

Thanks,

Thaw


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Thaw

@1: That would be the timezone of the server system time. So that depends on your hosting environment

@2: No it will not - it is always the server time.

Ecom:Order.Date template tag is just a datetime object, so you can easily convert it to whatever timezone you want. See .NET reference: https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx

Simply cast to a DateTime variable first: DateTime orderDate = (DateTime)GetValue("Ecom:Order.Date");

 
Thaw Htun Lynn
Reply

Thanks Nicolai. I will try that.

 

You must be logged in to post in the forum