I setup a published date for custom published date:
name: 'postedDate',
type: 'date',
but this date is always 1 day ahead in the api return value.
For example, I select
05/09/2023
and this is what is returned in the api
2023-05-10T02:58:59.000Z
. I assumed this is with the timezone? is it possible to just output the exact date selected in the date picker so I dont have to deal with different times?
Is it a local or hosted setup? Isn't it the settings of you machine that has an issue?
It is on local, I am not sure, I would think if I select May 9 from the date picker, the date it would return in the api would be May 9 as well but it is returning May 10
Is it possible this is the ISO date timezone conversion?
Yeah, i had to convert the date in frontend, it is not possible to set a default time zone for the api?
Not currently. Most advice would be to always store ISO date and convert wherever it is presented.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.