Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Setting default time zone

default discord avatar
nlvogellast year
3

Is there a way to set my preferred time zone for date fields?

  • default discord avatar
    samy7288last year

    Yes you can. According to the documentation you can you can set the

    localized

    attribute to

    true

    Here's the link of the screenshot :

    https://payloadcms.com/docs/fields/date#config

    Here's the link of the localization enable in the base config :


    https://payloadcms.com/docs/configuration/localization
    image.png
  • default discord avatar
    nlvogellast year

    @Sam thank you!

  • default discord avatar
    ingrid7414 months ago

    Couldn't find anything about it in the Docs. Switching on localization on the field doesn't change the date picker or set Time Zone on it.



    Date is stored as the Docs say YYYY-MM-DDTHH:mm:ss.SSSZ (e.g. 1999-01-01T8:00:00.000+05:00) but the time zone part is always +00:00 unless I missed a meeting 🙏



    The datetime stored in database is correct, it's just stored in UTC (without offset) so front ends can get Time Zone from their user and display it accordingly

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team..