Sign In Register

How can we help you today?

Start a new topic
Answered

getDate

Is there any API call to retrieve server's current date and time? I couldn't find something in the docs.


Thanks,


Best Answer

Hi Paul,


When you create a JavaScript Date object in the CloudCode it is initialized with the current time and date. To access it from the client, you could create a custom event and add the time/date information to the response.


Best,


Marcel


Answer

Hi Paul,


When you create a JavaScript Date object in the CloudCode it is initialized with the current time and date. To access it from the client, you could create a custom event and add the time/date information to the response.


Best,


Marcel

Thanks a lot Marcel!

"When you create a JavaScript Date object in the CloudCode it is initialized with the current time and date. To access it from the client, you could create a custom event and add the time/date information to the response."


Can you please help me with the detailed steps that I need to follow? 

I tried obtaining the date from a NTP server but that is not working 100% of the times.


 You can create a JS date using...

var dateNow - new Date();

Login to post a comment