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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:23:38+00:00 2026-06-09T04:23:38+00:00

I have some problem with IE (all versions). It don’t calculating the code of

  • 0

I have some problem with IE (all versions). It don’t calculating the code of timestamp. My code is below:

function compute() {
    var c = $('select#time_from_hour').val();
    var d = $('select#time_from_minute').val();
    var e = $('select#time_to_hour').val();
    var f = $('select#time_to_minute').val();
    var g = $('input#date_from').val();
    var h = $('input#date_to').val();
    var hour1 = g + ' ' + c + ':' + d; 
    var hour2 = h + ' ' + e + ':' + f; 

    hour1 = hour1.split("/"); 
    var hour1 = hour1[1] + "," + hour1[0] + "," + hour1[2];
    var timestamp = (new Date(hour1).getTime() / 1000) + 7200;
    $('#total_hour1').val(timestamp);

    hour2 = hour2.split("/"); 
    var hour2 = hour2[1] + "," + hour2[0] + "," + hour2[2];
    var timestamp = (new Date(hour2).getTime() / 1000) + 7200;
    $('#total_hour2').val(timestamp);

    var x = -$('input#total_hour1').val();
    var y = -$('input#total_hour2').val();
    var total_time = x - y; 
    result = total_time / 86400;
    new_number = Math.ceil(result); 

    if (isNaN(new_number)) { 
        var new_number = 0;
    }

    $('#finish_day').val(new_number);
}

$('select#time_from_hour').change(compute);
$('select#time_from_minute').change(compute);
$('select#time_to_hour').change(compute);
$('select#time_to_minute').change(compute);
// $('select#return_car').change(compute);
$('select#get_car').change(compute);
$('input#finish_day').change(compute);

On other modern browser (firefox, opera, chrome) everything works fine. Only on IE i got the “NaN” value in timestamp1 and timestamp2.

Thanks in advice.

  • 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-09T04:23:39+00:00Added an answer on June 9, 2026 at 4:23 am

    You seem to pass the Argument of the Date-Constructor in the wrong format. According to MSDN, the IE-Implementation of Date accepts the Date in the following order:

    function Date( year : int, month : int, date : int[, hours : int [, minutes : int [, seconds : int [, ms : int]]]] )
    

    If you make sure, that you pass the arguments in this format, everything should work fine. You’ll find the working Code here:
    http://jsfiddle.net/utXMD/

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

Sidebar

Related Questions

all, I have some problem installing my apk file in code. Wondering if anyone
  There is some problem code in a website I don't have source access
I have some interesting problem for an hour.. In my flex project, all width
Gday All, I have a baffling problem whilst trying to insert some chinese characters
I have some problem in my JDBC code. I am trying to connect through
There are some other questions where people have problems with timestamp being all zeros.
I have been experimenting some problems with the fully distributed version. First of all
I have some problem to get the utf-8 string from PHP using jQuery $.load()
I have some problem with the cursor when using JOprionPane. I set a cursor
I have some problem. Dialog.dismiss() does not work. I want to input ip, username,

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.