Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 648585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:50:57+00:00 2026-05-13T21:50:57+00:00

Edit: It’s not a bug as Martin pointed out. I’m just crossing the daylight

  • 0

Edit: It’s not a bug as Martin pointed out. I’m just crossing the daylight saving time, hence the 1h difference.

I want to calculate the difference in days between “Mar 29 2010” and “Mar 09 2010” so i have the following code:

((new Date(2010, 2, 29)).getTime() - (new Date(2010, 2, 8)).getTime()) / 86400000

86400000 is the number of milliseconds in a day and the difference between the dates is returned in milliseconds, so this should work. Only it doesn’t quite. I get

20.958333333333332

It’s the difference between those 2 dates that is wrong. It’s supposed to be 1814400000 (21 days times 86400000 ), but it actually is 1810800000.

Moreover if I change the difference to:

((new Date(2010, 2, 28)).getTime() - (new Date(2010, 2, 7)).getTime()) / 86400000

the same difference, only shifted one day back, i get normal results.

This happens only if we try to get (x-y) where x is after March 29 2010 and y is before March 29 2010.

I get this on Safari 4 and Firefox 3.6 on Mac, as well as IE 8 on windows 7. Haven’t tried other browsers.

Am I doing something wrong or is this a known bug ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:50:58+00:00Added an answer on May 13, 2026 at 9:50 pm

    You’re crossing a daylight saving time boundary, hence the 1 hour difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

edit alright, I guess C is painful in nature--Just, this part, is particularly painful.
Edit ok, great feedback here, got me pointed in the right direction. Use case
Edit: I just moved my HTTPRequest code into the onCreate, and now all of
EDIT: Sorry about ellipsis that's not what I actually have. For declaring an array
EDIT heres the github page if people want to have a look https://github.com/brandongrossutti/EventStore I
Edit: Made an official bug report at developers.Facebook.com GETing either of the following: graph.facebook.com/me/photos
EDIT : Summary : Git does not allow dates before 1973/03/03 09:46:40 (epoch+100000000s) given
[Edit: don't try to understand the whole thing and don't waste your time to
Edit : Array should be CvMat or IplImage is not an error message specific
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.