date() transformation UTC
See original GitHub issueTrying out yup and found this to happen on date transform
import * as yup from 'yup'
const schema = yup.object().shape({
date: yup.date().required()
})
console.log(schema.validateSync({date: '2020-01-01'}, {abortEarly: false}))
Gives me this result { date: 2019-12-31T23:00:00.000Z }
is there any way of forcing UTC on date transformation?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8
Top Results From Across the Web
UTC Time Now
UTC current date is 26th Monday December 2022. UTC: Coordinated Universal Time. About UTC Time.
Read more >Epoch Converter - Unix Timestamp Converter
Easy epoch/Unix timestamp converter for computer programmers. Includes epoch explanation and conversion syntax in various programming languages.
Read more >How to convert a Date to UTC? - Stack Overflow
Simple and stupid. var date = new Date(); var now_utc = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.
Read more >Formats for Dates and Time in UTC - Informatica Documentation
In the request and response, all dates and times are specified in UTC (Coordinated Universal Time), with or without an offset for a...
Read more >How to convert a date to UTC string in JavaScript
Use the toUTCString() method of the Date object. The toUTCString() method converts a date to a string using the universal time zone. const...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the ISO 8601 date time format. You can convert it to your local date time in frontend/backend.
Any solution for this?