question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

date() transformation UTC

See original GitHub issue

Trying 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:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:8

github_iconTop GitHub Comments

2reactions
matintangcommented, Dec 7, 2022

So are we just ignoring this issue?

image

This is the ISO 8601 date time format. You can convert it to your local date time in frontend/backend.

2reactions
ydhnwbcommented, Oct 13, 2021

Any solution for this?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found