When using the field timestamp
I see that my timezone is displayed and affects the time that I am setting up. We would like to use timestamp without timezone because we want to display all our events in a fixed timezone independently of our editors timezone. How can we achieve that?
Hi there,
Thank you for contributing to the Prismic community.
In fact, the time is dependent on your locale chosen. But if you want to strip the timeZone, then the best way is to strip it from the Date you receive from the API; you can use it using some libraries such as Moments.js with the help of a date formatted, or by getting UTC date.
Please let me if that doesn't answer your inquiry,
Fares
That doesn't answer the inquiry actually. Say that we use the Date field in prismic and we want to set up all our events to be displayed in PST time independently of the time zone of the editors.
I log in from Germany and I add the event date that I want to be output as May 5, 11AM and when I do that, I want to indicate PST not Germany. However prismic date will add MY timezone to that 11AM I indicated. That's not the PST time I wanted.
Then someone from Los Angeles logs in and adds a date in another event. This person adds May 6 6PM pst, which is the right time for the event, but if I log in into the CMS, I'll see this date converted into my timezone, not PST.
And then graphql with output a date with UTC independently of the time zone I wanted to use.
And that's extremely frustrating and impossible to work with.
Hello everyone,
I have exactly the same issue. I want to display event time, e.g. 07.15-07.45 PM and on top of that, I have a Select field that gives the ability to pick timezone from the list. The final representation should be "07.15-07.45 PM EST".
If I understood right, the API will return date converted to UTC, so if I set event start time to 07:00 and if I'm in New York (UTC-04:00) I'll have 4 hours difference.
I think Date field should be able to work with UTC, but I suppose it's not possible at the moment, so if you have any suggestions, please let me know.
Any more help on this topic?
Well actually API returns UTC date as a standard, you can add a select field to select the time zone from as @slazic suggested.
Hi @rootdev,
I've checked with my team, and I might missed the point.
If your query is that you want to be able to set a default timezone in the Prismic UI. So when viewing or selecting a date in Prismic, it will always use a certain zone (PST in their case) even if the content editor is in another time zone.
In fact, such a feature don't exist currently, so I will create a feature request and send it to your @features-team
This is being tracked as an open feature request.
If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the button to show your support for the feature and check out our Feature Request Guidelines.
Any update on this?
In the current form there's no way I'm going to attempt to explain this behavior to my client. I'd like to use this for events, which may not / frequently do not happen in the timezone of the person looking at the data, and it's extremely common for people to add / edit these from different timezones.
In the current form it's extremely confusing. I'm not even sure what this field is intended for without being able to control the timezone.