Skip to content

Truncate milliseconds shorthand in ISO #1412

New issue

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EzeGmnz
Copy link

@EzeGmnz EzeGmnz commented Apr 2, 2023

Adds a new parameter to DateTime#toISO and toISOTime called truncateMilliseconds which will remove the milliseconds from the format, irrespective of their value.

Added tests

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 2, 2023

CLA Missing ID

  • ✅login: EzeGmnz / (fdf6016)
  • ❌ The commit (615ccf8, d1c8e29). This user is authorized, but they must confirm their affiliation with their company. Start the authorization process by clicking here, click "Corporate", select the appropriate company from the list, then confirm your affiliation on the page that appears. For further assistance with EasyCLA, please submit a support request ticket.

@erdnaxeli
Copy link

Hi, any news about this? this would be very helpful. Thanks!

@BalusC
Copy link

BalusC commented Nov 21, 2024

I see this is still not merged while this is certainly useful.

For the time being, this can be work arounded as follows:

dateTime.startOf("second").toISO({ suppressMilliseconds: true });

@Konafets
Copy link

What is the status of this issue?

@dobon
Copy link
Contributor

dobon commented May 27, 2025

What is the status of this issue?

This functionality is added by #1670 which will be released on the next release of luxon (soon, I think?). It adds an optional precision parameter for toISO, which you can configure to truncate milliseconds reliably.

This PR can be closed as duplicate.

@NogaMan
Copy link

NogaMan commented Jun 4, 2025

When is the next release of luxon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants