cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

While using getHours, it is not providing server time.

AP_10343008
15-Moonstone

While using getHours, it is not providing server time.

let currentDate = new Date();
result = currentDate.getHours();

 

This is not returning server time. How to get server tdate and time in thingworx

ACCEPTED SOLUTION

Accepted Solutions

Both new Date() and Date.now() do return server time. Mind you, when you do getHour(), it returns you the hour in the server time zone, which is often UTC, and might not be what you expect.

View solution in original post

1 REPLY 1

Both new Date() and Date.now() do return server time. Mind you, when you do getHour(), it returns you the hour in the server time zone, which is often UTC, and might not be what you expect.

Announcements


Top Tags