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
get unix timestamp of given date #372
Comments
@ravins right now you can use standard JavaScript method
But I think this indeed is a gap of the library so we'll probably make a shortcut function for (converting to dates + getting timestamp) ASAP. Stay tuned! |
One of the key values of date-fns is to not repeat existing API, but encourage to use the built-in functionality as long as it's pitfall-free. Hence this is a documentation, not a feature gap. |
@kossnocorp don't forget that we already have functions that repeat functionality of JavaScript standard library (like |
Nevermind then 🤣 |
@ravins hello! Released the function with v1.26.0: https://date-fns.org/docs/getTime |
the issue says unix timestamp but shouldn't unix timestamps be in seconds not milliseconds? |
|
Hi @ravins the solution here isn't complete. The result is in milliseconds you need to divide by 1000 to get unix timestamp value. Like below :
|
@kossnocorp where can we find the documentation on the new function |
Is it current supported? In moment we have moment.valueOf()
The text was updated successfully, but these errors were encountered: