Skip to content
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

Feature Request: Difference between datetimes #40

Closed
shayant98 opened this issue Mar 15, 2024 · 1 comment
Closed

Feature Request: Difference between datetimes #40

shayant98 opened this issue Mar 15, 2024 · 1 comment

Comments

@shayant98
Copy link

Hi I really like this new library, but for me to migrate to it I really need the functionality of manipulating dates.

Given two Dates:
D1 = 2010-06-09T15:32:00Z
D2 = 2010-06-09T11:32:00Z

It should return 4 hours (or eq. in days/min/sec)

@justin-schroeder
Copy link
Member

Date objects already have this capability as they are cast to milliseconds when combined with logical operators:

const diff = D1-D2

Perhaps there is other functionality you are looking for like formatting relative time? You can follow #7 to track that feature request.

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

No branches or pull requests

2 participants