I am trying to display two countries time on my website. I have achieved the NZ time ( NZ time: 12:13pm Sunday, 26 May 2013 (NZST) ) but require help to set time for Australia ( AUS time: ). Any suggestions will be appreciated.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I am trying to display two countries time on my website. I have achieved the NZ time ( NZ time: 12:13pm Sunday, 26 May 2013 (NZST) ) but require help to set time for Australia ( AUS time: ). Any suggestions will be appreciated.
AUS is a little trickier than NZ as it has multiple time zones (dam WA which can be 3 - 4 hours behind NZ).
A simple example would be on the model object put a new public function
public function aus_time() {
return date('Y / m / d G:i:s', strtotime('+2 hours'));
}
{$myobject.aus_time}
Thank you very much for your help. i will have to change the code a little bit to get the format i wanted but nice it is working.