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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Question for UTC time

DK2
2-Explorer
2-Explorer

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
slangley
23-Emerald II
(To:DK2)

Hi @DK2.

 

Which product?

DK2
2-Explorer
2-Explorer
(To:slangley)

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.
Announcements

Top Tags