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 8248011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:03:05+00:00 2026-06-07T23:03:05+00:00

I am trying to understand something about getTime() , My problem is that, I

  • 0

I am trying to understand something about getTime(),
My problem is that,
I am setting up a new Date with lets say: 23,07,2012.
When I am using getTime() on it I should get the milliseconds Since 01,01,1970.
When I divide the value I getting from getTime() with (1000*60*60*24) I should get the days number was pass since 01,01,1970 until 05,07,2012 but somehow I get a number with a Decimal point (15543.875) I dont understand why, I mean since 01,01,1970 and 23,07,2012 I should get an integer(that what I think), well I know I am really wrong, if can someone please help me understand why the decimal point at the result.

  • 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-06-07T23:03:06+00:00Added an answer on June 7, 2026 at 11:03 pm

    If you are setting a date like new Date(2012, 06, 23) It will be set according to the timezone of the client, where as .getTime() is UTC. You want Date.UTC:

    Date.UTC(2012,6,23) / (1000*60*60*24)
    //15544 For any computer
    
    new Date(2012, 06, 23) / (1000*60*60*24)
    //15543.875 For my computer, I am coincidentally in  the same timezone as Israel. This result will depend on what timezone the client is.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Ruby and now trying to understand something about metaprogramming. I
I am new to Mac development and are trying to understand the location that
I have been trying to understand what should be the right way in using
I am trying to understand a little more about memory management. Knowing that I
I am trying to understand something about ArrayObject and ArrayIterator classes ArrayObject : This
I'm trying to understand a problem I have run into that I don't believe
Trying to understand something. I created a d:\svn\repository on my server. I committed folders
I'm trying to understand on a deeper level if I'm missing something as to
I am trying to understand the difference between this: if (isset($_POST['Submit'])) { //do something
I'm trying to understand REST. Under REST a GET must not trigger something transactional

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.