We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Possible to get entry_date and edit_date not localized in template?

Developer Preview

TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

Is it possible to get entry_date and edit_date to always output un-localized in a template?

{entry_date format="%g:%i %A"} – {expiration_date format="%g:%i %A"}

I need for that output to always read as the date set in the timezone the system is set up to use.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
7 years ago
Kevin Cupp's avatar Kevin Cupp

It should always use the site timezone for logged-out users, but you can force a timezone if you want by adding the timezone= parameter.

       
TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

Sweet. Timezone parameter confirmed working. Is that in the docs? I can’t seem to find it anywhere, hence why I didn’t know to use it.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
7 years ago
Kevin Cupp's avatar Kevin Cupp

Great! Yes it’s here: https://docs.expressionengine.com/latest/templates/date_variable_formatting.html#timezone

       
TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

Ah hah!

What’s odd is I searched for timezone in the search input up on the left and that didn’t come up. And I was looking in the wrong place for it otherwise.

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones
What’s odd is I searched for timezone in the search input up on the left and that didn’t come up. And I was looking in the wrong place for it otherwise.

h4s were not being indexed; fixed, thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.