Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Time Widget

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1841 Views
  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Time Widget Link to this post

    I have created a widget that allows you to see the current time in different cities/countries around the world.

    http://silverstripe.com/widgets/

  • lancer
    Avatar
    57 Posts

    Re: Time Widget Link to this post

    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?

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Time Widget Link to this post

    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.

  • lancer
    Avatar
    57 Posts

    Re: Time Widget Link to this post

    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

  • ulysses
    Avatar
    Community Member
    57 Posts

    Re: Time Widget Link to this post

    The time widget only displays the title but not the time.

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Time Widget Link to this post

    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.

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Time Widget Link to this post

    And now it's been updated, and is available for download. This version requires 2.2.2.

    1841 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.