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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:17:25+00:00 2026-05-26T07:17:25+00:00

I am working on an app where there is a need for a reliable,

  • 0

I am working on an app where there is a need for a reliable, accurate timestamp in JavaScript. As such, I would prefer not to rely on the client system time. Although it is likely to be correct, I need something more certain.

I was hoping there was an API available from a well endowed provider such as Google that would allow me to access an accurate timestamp from some server somewhere. I haven’t been able to find that, so I came up with another idea: create a tiny dummy file on our server, retrieve it via AJAX and extract our own server’s timestamp from response headers:

$.ajax({
 type: 'POST',
 url: 'dummy.json',
 complete: function (response) {
   // header is available as a string: response.getAllResponseHeaders();
 }
}

Headers:

Date: Fri, 14 Oct 2011 14:07:41 GMT
Content-length: 18
Last-modified: Thu, 13 Oct 2011 20:35:28 GMT
Server: Netscape-Enterprise/6.1 AOL
Etag: "0-0-12-0"
Content-type: text/plain
Accept-ranges: bytes

Is this not the most ridiculous work-around ever? Am I going crazy? Is there a better solution?

If not could somebody help me write a regex to extract just the date from the above response header string?

edit: forgot to mention the reason why this is a problem is I don’t have access to the backend to create some simple service for polling a timestamp from the server or anything like that. I have to do it in JavaScript for this particular application.

  • 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-26T07:17:25+00:00Added an answer on May 26, 2026 at 7:17 am

    Nothing wrong with your solution, but there are plenty of web services out there. Google quickly reveals this service from Yahoo and this one from earthtools. They all work, it’s just a matter of choosing the one that fits best for you.

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

Sidebar

Related Questions

So, I'm working on a mapping application. In the app there are these toolbars
I'm working on a UINavigationController driven iPad app (testing in the simulator). There are
I just began working on a little twitter-app using tweepy. is there any kind
I'm working with a C++ audio library in an iPhone app. Is there any
I am working on an application where I need to detect a system shutdown.
I'm working on an app in which I need to scan through a string
So I have been working with an app where I need to show the
Edit : What I really need to know is if there is any javascript
I'm working on a voting app where I need to send an email to
I'm working on an app where there are two different NSManagedObject types that might

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.