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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:51:08+00:00 2026-05-24T07:51:08+00:00

I am trying to get the Time from a NIST timeserver. How can I

  • 0

I am trying to get the Time from a NIST timeserver. How can I do this. I can use any language but I prefer php

  • 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-24T07:51:09+00:00Added an answer on May 24, 2026 at 7:51 am
    <?php
    /* Query a time server
       (C) 1999-09-29, Ralf D. Kloth (QRQ.software) <ralf at qrq.de> */
    $timeserver = "ntp1.sf-bay.org";
    $timercvd = query_time_server($timeserver,37);
    if (!$timercvd[1]) { # if no error from query_time_server
      $timevalue = bin2hex ($timercvd[0]);
      $timevalue = abs (HexDec('7fffffff') - HexDec($timevalue) - HexDec('7fffffff')) ;
      $tmestamp = $timevalue - 2208988800; # convert to UNIX epoch time stamp
      $datum = date("Y-m-d (D) H:i:s",$tmestamp - date("Z",$tmestamp)); /* incl time zone offset */
      $doy = (date("z",$tmestamp)+1);
    
      echo "Time check from time server ",$timeserver," : [<font color=\"red\">",$timevalue,"</font>]";
      echo " (seconds since 1900-01-01 00:00.00).<br>\n";
      echo "The current date and universal time is ",$datum," UTC. ";
      echo "It is day ",$doy," of this year.<br>\n";
      echo "The unix epoch time stamp is $tmestamp.<br>\n";
    } #if (!$timercvd)
    else {
      echo "Unfortunately, the time server $timeserver could not be reached at this time. ";
      echo "$timercvd[1] $timercvd[2].<br>\n";
    } # else
    ?>
    

    source

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

Sidebar

Related Questions

What I'm trying to do is to use ajax to get time from another
Here's what im trying to do <?php //get time from what user input on
I'm trying to get a report down from the 20+ minute run time and
I've spent too much time trying to get this to work on IE 7.
I'm trying get some licensing code from AndroidPit.com working, but I get Unable to
I am trying to get a time stamp into a textview or any view
i am trying to get the time passed from the moment i posted a
Im trying to get the time elapsed from a specific date (in millis) In
I'm trying to get the time from a Bootstrap Timepicker using the getTime function,
I'm trying to figure out how to get the gps time from the gps

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.