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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:05:44+00:00 2026-06-06T17:05:44+00:00

I am baffled. I have a ready function, from jQuery, which sets an HTML5

  • 0

I am baffled. I have a “ready” function, from jQuery, which sets an HTML5 sessionStorage variable to the .valueOf() result of a new Date (as shown below). Somehow, though, the variable keeps refreshing and updating the time while my page is open. The sessionStorage variable doesn’t even know it’s a Date, it just stores the milliseconds, and the “ready” function is only called once at the beginning (I’ve checked using an alert window). There is no logic in my code to make this happen, but the value on the page stays up-to-date in real time. Any ideas?

// Initialize default date range
if (sessionStorage.minDate == null) {
    d = new Date();
    sessionStorage.minDate = (d.valueOf() - 172800000);
    delete d;
}
if (sessionStorage.maxDate == null) {
    d = new Date();
    sessionStorage.maxDate = d.valueOf();
    delete d;
}

UPDATE:
Still not fixed, but I’ve tried giving the milliseconds as a literal, and it still does the same thing. So it must have something to do with the fact that I’m creating a new Date later on using the millisecond count.

Any thoughts are much appreciated. I really have to get this working for work.

  • 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-06T17:05:46+00:00Added an answer on June 6, 2026 at 5:05 pm

    Apparently I was storing the number of milliseconds as a string, and wasn’t parsing it back into an integer, so when I tried to create a new Date with it, javascript didn’t know what to make of it and just created a Date with no parameters: the current date and time.

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

Sidebar

Related Questions

So I am baffled by this one. I have a function that is responsible
I have a little piece of code which populates a CellTable from a Type
Hello I'm a bit baffled that the cursor I have in this function is
I have an issue that I'm basically baffled by. To start off, I have
I'm baffled as to what this SQL statement means: SELECT exhibitor_categories+0 from exhibitor_registry What
I have been looking for an hour and am baffled why the SignalR sample
I've done extensive research on this, and am baffled. Similar questions on stackoverflow have
I'm really baffled by this. Have I managed to do something to cause this,
The last two Apps I have submitted and have had released (they're both Ready
I'm honestly baffled by why this is throwing this particular exception. If I have

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.