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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

how to set time to zero

MK_9986318
5-Regular Member

how to set time to zero

how to set the time to zero.

 

where I am using

startDate = '2021-01-01'

date1 = parseDate(startDate,"yyyy-MM-dd HH:mm:ss.SSS");

 

I want the the date1 to be date1 = 2021-01-01 00:00:00.000;

 

where I am getting it as '2021-01-01 10:00:00.000';

 

how can I make time as zero.

1 REPLY 1
yhan
17-Peridot
(To:MK_9986318)

How about using Date.parse() method like below:

var startDate = '2021-01-01';
var result = Date.parse(startDate);

 

Top Tags