Support » Plugin: TablePress » Specify [table-info] last_modified date timezone

  • Resolved tyman00

    (@tyman00)


    Is it possible to pass any parameters along to [table-info id=X field=”last_modified” format=”raw” /] (or even format=”date time”) that will allow us to display the time in a specific timezone instead of just GMT?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    TablePress by default supports five formats for the last_modified field, namely raw, human, date, time, and mysql.
    Direct support for time zones is not included, sorry. TablePress uses the time zone that is configured for WordPress here, so maybe you’ll just have to change that in the settings?

    Your best chance to change output to a different time zone would be to parse the output and return in your desired way. For this, you could either use the tablepress_shortcode_table_info_output filter hook (defined here) or you could add your own Shortcode as a wrapper around the tablepress_get_table_info() template tag function (defined here).
    In both cases, you’d need some custom PHP code.

    Regards,
    Tobias

    Thanks @tobiasbg

    I thought we had the timezone set for WordPress, but we didn’t. It was something so simple. I appreciate the other information for the filter hook and template tag function wrapper. It could be useful for other projects.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.