I know this can be done by:
- Comparing hour and minutes etc..
- Comparing date.getTime() % 86400000
- comparing date.toLocaleTimeString()
is there a straight forward way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to compare just the time component, you can do:
You may not care about the milliseconds.
If you know that daylight saving is never observed at the location, or the times are UTC, you could do:
or