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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:17+00:00 2026-05-28T00:36:17+00:00

Need of time server services I am trying to build a web application in

  • 0

Need of time server services

I am trying to build a web application in ASP.NET and I need to retrieve time from a time server. Explaining the reasons why I need to do this is too long, however, I need, basically speaking, to connect to a time server (through web services hopefully) and retrieve that server current time.

NTP is a possible solution (question)

I know the existance of the NTP protocol and that it can be used for these purposes. However how is it possible to locate server addresses and use web services in order to get time?

Expecting web services

I, in fact, expect web services to be used for these reasons. However, by searching, I could not find any, also in the NTP official site.

How can I get time info from a server in my web app?

Thankyou

  • 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-28T00:36:17+00:00Added an answer on May 28, 2026 at 12:36 am

    You don’t say how you want to choose which server’s time you want to get. I suppose that the reason you want to get the time from a remote server in the first place is that your code is running on a device without a local clock.

    You can certainly make a client NTP request to some NTP server to get the time. Perhaps you would like to use pool.ntp.org as the NTP server.

    But if you prefer to use a web service, that’s fortunate because you can in fact get the current time from just about any web server in existence: they happen to emit it in the HTTP header of every response they send! Note the Date header in this HTTP response from http://stackoverflow.com/ right now:

    curl --head http://stackoverflow.com/
    HTTP/1.1 200 OK
    Cache-Control: public, max-age=3
    Content-Length: 197603
    Content-Type: text/html; charset=utf-8
    Expires: Thu, 05 Jan 2012 17:59:47 GMT
    Last-Modified: Thu, 05 Jan 2012 17:58:47 GMT
    Vary: *
    Date: Thu, 05 Jan 2012 17:59:42 GMT
     
    

    So just choose a web server, make an HTTP request to it (for any page) and get the current time from the Date header in the response. You can use the HEAD method instead of the GET method as I did in the curl example because you don’t actually need the body of the response.

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

Sidebar

Related Questions

I need to return server time from a webservice. I've got the following code:
I need to implement time calculation for repository methods in my asp .net mvc
From time to time I need to run a full build of the entire
I am trying to build a real-time web service that deals with dynamic 10k
Trying to find a way to rapidly develop web services on the Mac Server
I need to communicate with an XML-RPC server from a .NET 2.0 client. Can
How to create simple PHP COMET server page displaying current time? I need code
I have a pretty simple client-server ASP.NET app; communication is via WCF service. All
So, I'm working in a hybrid web app/mvc application. Trying to do all new
I a trying to set up a real time game server that runs a

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.