We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When you create a dayjs object, add 1 milliseconds to it and format to string, the string doesnt include the added milliseconds
const timestamp = dayjs(); console.log(timestamp.format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> SAME console.log(timestamp.add(1, 'millisecond').format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> SAME console.log(timestamp.add(0.001, 'second').format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> SAME
Expected behavior When you create a dayjs object, add 1 milliseconds to it and format to string, the string format should have the added milliseconds
const timestamp = dayjs(); console.log(timestamp.format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> X console.log(timestamp.add(1, 'millisecond').format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> X + 1 milliseconds console.log(timestamp.add(0.001, 'second').format('YYYY-MM-DDTHH:mm:ss.sss')) // ---> X + 1 milliseconds
Information
Example https://runkit.com/joni7777/dayjs-milliseconds-issue
The text was updated successfully, but these errors were encountered:
https://runkit.com/embed/1wlzrozab430 seems ok?
Sorry, something went wrong.
@iamkun Yea the valueOf() is working as expected, but the format() is not using the milliseconds
It was may bad, i had a bad format for milliseconds, used 'YYYY-MM-DDTHH:mm:ss.sss' instead of 'YYYY-MM-DDTHH:mm:ss.SSS' (the .SSS in the end) 🤦♂️
'YYYY-MM-DDTHH:mm:ss.sss'
'YYYY-MM-DDTHH:mm:ss.SSS'
.SSS
As reference for others. https://day.js.org/docs/en/display/format
No branches or pull requests
Describe the bug
When you create a dayjs object, add 1 milliseconds to it and format to string, the string doesnt include the added milliseconds
Expected behavior
When you create a dayjs object, add 1 milliseconds to it and format to string, the string format should have the added milliseconds
Information
Example
https://runkit.com/joni7777/dayjs-milliseconds-issue
The text was updated successfully, but these errors were encountered: