I try to modify default New Order email template.
Currently, I get order datetime by {{var order.getCreatedAtFormated('short')}}
.
It results 6/18/2015 12:18 PM
.
I want to include timezone following datetime, expected result is 6/18/2015 12:18 PM GMT+7
.
I dive into Magento Core code to understand how it works, then I try
{{var order.getCreatedAtFormated('short')}} {{var order.getCreatedAtStoreDate().getTimezone()}}
but it doesn't work.
I know that if it works, getTimezone()
may result Asisa/Saigon
instead of GMT+7
as expected.
So, how to get order datetime including timezone?
Best Answer
There is no native function to get the GMT time value.
To get the GMT value of order created datatime.
I have
rewrite
theMage_Sales_Model_Order
and write new function to get the GMT.(Refer magento model rewrite Tutorial)
Now you can get GMT value in email template by following code.
I have refer these two links to get the GMT value
1.how do i get greenwich mean time in php
2.datetime to timestamp in php