• Resolved Guido

    (@guido07111975)


    Hi,

    Because of the new function wp_date() I have updated the date fields of my events plugin, but run into a timezone problem. In some cases the wrong day is being returned. Depending on the timezone.

    I simply replaced all occurences of date_i18n() with wp_date(). Example:
    This:

    
    date_i18n( $dateformat, esc_attr( $date ) )
    

    Became this:

    
    wp_date( $dateformat, esc_attr( $date ) )
    

    But I now notice there’s a third parameter, called $timezone, so I thought adding the default value null fixes my problem. But no change, because null seems to be the PHP time().

    Who can tell me how to fix this? No timezone should be added when outputting the date.

    Guido

    ps. I initially thought it was a Core issue, so have already created a ticket at Make Core, but apparently I’m doing it wrong, so ticket is closed.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problems with timezone when using new function wp_date()’ is closed to new replies.