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

How to convert date offset value(Number) to datetime format?

SOLVED
Highlighted
Amethyst

How to convert date offset value(Number) to datetime format?

Hi

i need find yesterday date and  also i need to set hours also, but if i used sethours function datetime format automatically convert into number , if i apply function  setDate on offset value it will thourgh error?

here is code

var d = new Date();
var c =d.setHours(00,00,00,000);
var result =c.setDate(c.getDate() - 1);

i needto find yesterday date and  hours should be 00,00,00,000

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to convert date offset value(Number) to datetime format?

That will be the code, but you must know that it will be done at Server Side TimeZone:

 

var result = new Date();
result = dateAddDays(result,-1);
result.setHours(0,0,0,0);

View solution in original post

1 REPLY 1
Highlighted

Re: How to convert date offset value(Number) to datetime format?

That will be the code, but you must know that it will be done at Server Side TimeZone:

 

var result = new Date();
result = dateAddDays(result,-1);
result.setHours(0,0,0,0);

View solution in original post

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!