I have created a widget that allows you to see the current time in different cities/countries around the world.
We've moved the forum!
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.
The DateTimeZone class is still experimental. It is not enabled by default in e.g. PHP5.1. It works on my Fedora 8 system, but doesn't on my Centos 5.1 server.
Something to fix or document?
That's strange. php.net says that all Date functions/classes are enabled by default since the first version they were included in, which is 5.1.0 for all the classes I use.
Can you confirm if the functions work? If they do, I can change the widget to use the functions instead of classes.
No the functions are not there either.
[lancer@blackbird ~]$ ./test.php
PHP Fatal error: Call to undefined function date_create() in /home/lancer/test.php on line 4
[lancer@blackbird ~]$ rpm -qi php
Name : php Relocations: (not relocatable)
Version : 5.1.6 Vendor: CentOS
Release : 15.el5 Build Date: Thu 20 Sep 2007 04:25:35
The time widget only displays the title but not the time.
That should only happen if none of the locations are set.
Will release a version soonish (will need to get checked by SS though) that has a better check that at least one location is set, can be translated and wont display if the DateTime and DateTimeZone classes don't exist.
And now it's been updated, and is available for download. This version requires 2.2.2.