WordPress.org

Support

Support » Plugins and Hacks » PHP Code Widget » [Resolved] Strange situation with results.. date func php

[Resolved] Strange situation with results.. date func php

  • Strange thing.

    I have php code inserted in widget, it works but right now (at this moment) function date(j) returns 22..
    when I run the same (copypaste) php code in the separate file on the same server – it’s 23.. 🙂

    How is it possible? Widget is not cached (I changed echo text in the code – can see the update). But why does the date works that way?

    http://wordpress.org/extend/plugins/php-code-widget/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    WordPress standardizes the timezone of the system to GMT in order to produce consistent date calculations and to be able to handle daylight savings appropriately.

    You can use date_i18n() in WordPress to produce the same result, but with the correct time, and also localized according to your language pack (if you have one). It takes the timezone settings of WordPress into account.

    Thank you, Samuel!

    Now I see, thanks for your quick answer! Actually it’s even good in my case, some “delay” is ok 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Strange situation with results.. date func php’ is closed to new replies.
Skip to toolbar