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

Question for UTC time

Highlighted
Newbie

Question for UTC time

How to get UTC time in "DATETIME" format in service? . i want to store UTC time in result variable in services. result datatype is "DATETIME". i can get UTC time in string format. but not able to get UTC time in "DATETIME" format.please help me.

2 REPLIES 2
Highlighted

Re: Question for UTC time

Hi @DK2.

 

Which product?

Highlighted

Re: Question for UTC time

Hi Slangley,
Thai is not for a product. I am trying to do this.
I am using this code :- var date = new Date();
var utcDate = date.toUTCString(); or var s = date.toISOString();
Both lines are giving me UTC time but in string format like "Wed Feb 12 2020 15:07:27 GMT-0000 (GMT)".
But when I convert this UTC string into datetime format using parseDate function like parseDate (utcDate, "yyyy-MM-dd HH:mm:ss"); or using new Date function like var dateString = new Date(utcDate)
It is giving me my system date in place of UTC time .
I have one variable "result" and data type is for that DATETIME .
Main Question :- I want UTC time in datetime format and want to assign in result variable.