• max_Q

    (@max_q)


    Hi,
    Adding a time zone allows the submitted time to be correct for whatever timezone the WordPress installation is set to. Adding:

    date_default_timezone_set( get_option( ‘timezone_string’, ‘America/New_York’ ) );

    just before
    $time = time();
    on line 2649 of accua-forms.php sets the timezone to the WordPress options setting, with an optional fallback to US east coast (but the default could be anything or nothing).

    https://wordpress.org/plugins/contact-forms/

Viewing 1 replies (of 1 total)
  • Plugin Author cimatti

    (@cimatti)

    Hi,

    time() returns the timestamp as seconds after 1970-01-01 00:00:00 UTC and doesn’t changes with the timezone settings. $time is used a few lines below with gmdate() to save the date in UTC in the database format.

    I think there it should save the timestamp in UTC; probably I should check that the database saves in UTC correctly and do do the timezone conversion when the data is displayed

Viewing 1 replies (of 1 total)

The topic ‘Localize submitted time’ is closed to new replies.