How To Get Server Time in Javascript

Spread the love

As you know javascript is a client side scripting language.and if we are simply using Date() function in our javascript then it will print our local PC date/time.But what to do if we need server date and time.If you are facing the same problem then this post is for you.Check below script and get server time 🙂

The Function :

This unique JavaScript allows you to display the server time of your website, live! put this code in your body or external .js file and call serverTime function.

Calling Function

The above function will alert excet date of your server.You can also fetch time from today variable.

Hope it will Help You and please subscribe me and like my facebook page :

and make me proud.By the way if you face any problem then let me know in comment section below

Leave a Reply

Your email address will not be published. Required fields are marked *