πŸ‘€ Our most exciting product launch yet πŸš€ Join us May 8th for Sanity Connect

Sanity Date Schema - How to Set a Date for a Document

6 replies
Last updated: Apr 6, 2021
Hey all~A little strange thing... I am using the snaity date schema type to set the date for one of my documents... When I type it a date (yyyy-mm-dd) or use the calendar UI date picker... it always sets it to the day before. If i type or select 2021-03-09 then the date showing on my screen in the field would be 2021-03-08? Strange... here are my sanity versions that I am using

@sanity/cli             2.7.1 (up to date)
@sanity/base            2.7.1 (up to date)
@sanity/color-input     2.2.6 (up to date)
@sanity/components      2.2.6 (up to date)
@sanity/core            2.7.1 (up to date)
@sanity/dashboard       2.7.0 (up to date)
@sanity/default-layout  2.7.1 (up to date)
@sanity/default-login   2.7.0 (up to date)
@sanity/desk-tool       2.7.1 (up to date)
@sanity/vision          2.7.0 (up to date)
Mar 26, 2021, 6:02 PM
Here is an image of the studio showing the date picker
Mar 26, 2021, 6:03 PM
You think this is a timezone issue?
Mar 26, 2021, 6:30 PM
maybe... i'm in the EDT i know that used to have to adjust it when i get the date out of sanity due to the time difference...
Mar 26, 2021, 8:12 PM
Pretty sure they updated the date picker the other day. If it's a bug they now ask people to submit an issue to the GitHub repo.
Mar 26, 2021, 8:13 PM
will do thanks!
Mar 26, 2021, 8:20 PM
Thanks for reporting
user R
, this should be fixed in the latest release
Apr 6, 2021, 9:12 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?