Answer the question
In order to leave comments, you need to log in
To receive on the client time from the server?
I want this function to be on the server and that I get time from there, but I can’t figure out how to access it. How can I do it? I just get that if people. will transfer the time to the computer, then everything is OK. How to organize all this correctly?
function timeOf(offset) {
var d, utc, nd;
d = new Date();
utc = d.getTime() + (d.getTimezoneOffset() * 60000);
nd = new Date(utc + (3600000 * offset));
return nd.toLocaleTimeString();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question