Skip to main content
1-Visitor
August 31, 2021
Question

how to set time to zero

  • August 31, 2021
  • 1 reply
  • 980 views

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

17-Peridot
August 31, 2021

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

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