Skip to main content
1-Visitor
April 28, 2021
Solved

Difference in time

  • April 28, 2021
  • 1 reply
  • 946 views

Hi! I have a field of the DateTime type in the Grid, where the time is +4 compared to mine. How can I remove this difference?

Best answer by yhan

Hi @Mr_Henry_M,

 

You can refer to  below js code:

//convert date to ms in my time zone

var myTime = Date.parse(originalDate) - 4*60*60*1000;

//convert ms to date

var newDate = new Date(myTime);

 

Then you can use the new date parameter in your service 

 

Thanks,

/Yoyo

 

1 reply

yhan17-PeridotAnswer
17-Peridot
April 28, 2021

Hi @Mr_Henry_M,

 

You can refer to  below js code:

//convert date to ms in my time zone

var myTime = Date.parse(originalDate) - 4*60*60*1000;

//convert ms to date

var newDate = new Date(myTime);

 

Then you can use the new date parameter in your service 

 

Thanks,

/Yoyo

 

1-Visitor
April 28, 2021

Thanks a lot!