Trying to get Atomic Time via PHP or Javascript

Hi Everyone,
I'm working on a project that will need to track when the users log into the website.  Is there any way that I can get the atomic time over PHP or Javascript that I can then assign to a variable and send to a database?  Any help would be greatly appreciated!  Thanks all!
dcaggianoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimYatesCommented:
What do you mean by "Atomic time"?
Deepak VasudevanGlobal TravellerCommented:
By Atomic time, I guess, do you point Military Time. Check out this:

www.jsmadeeasy.com/javascripts/ Clocks%20And%20Date/Military%20Time%20Clock
dcaggianoAuthor Commented:
Yes, I guess I meant military time.  Or syncing with the atomic clock.  Right now the problem I have is that the time of the server where I am hosting my site is off by 13 minutes.  I am creating a punch clock program to track my employees check in and breaks at work.  I needed to make sure the time was consistent and also accurate.  That is why I was looking to sync with the atomic clock.  I will try this code out and see if it works.  I will get back to you as soon as I try it.  Thanks for responding so quick!
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

dcaggianoAuthor Commented:
This script is getting the time from the users computer and will not work for my application.  Here is the problem.  If the user changes his time and then logs into my punchclock program, he/she can say he logged in or logged out whenever he wants by just changing his/her time on the windows taskbar.  That is why I need to get the time from the atomic clock or some other accurate source that can't be changed.
TimYatesCommented:
why not just get the time of the main server?

Then it doesn't matter what they change the time to on their machine...

Tim
dcaggianoAuthor Commented:
I am actually doing that right now, but the server time is off by an hour and 13 minutes (and some odd seconds).  I also wanted to be able to redistribute this software later on so I don't want to have to code an adjustment in the time for every person I give it to.
amit_gCommented:
http://www.kloth.net/software/timesrv1.php

You can use any servers listed in http://tf.nist.gov/service/time-servers.html

Please note that this service is designed for server time sync and so if your page/website is heavely used, your IP might get blocked for making too many requests. The ideal way of doing this is to sync the domain server and other servers in the domain via that domain server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dcaggianoAuthor Commented:
Hmm, seems interesting.  I will be checking this out more in depth on monday.  Tim and Amit, thanks for both of your help so far.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.