I have a C# application that return in JSON an expiration date of an authentication token like this:
\"expirationDate\":\"Fri, 27 Mar 2015 09:12:45 GMT\"
As other said, JavaScript uses clients system time, but you can create date object from server time, so every client will get the same current time.
var date = new Date("");
It will work only on page load. If you want to check later for dates still valid, then you need to synchronize current date with server date every couple of seconds.