Subtract 1 hour from current time

I am using the following to display the current time on a webpage.   How would i substract i hour from the current time?
Mike_StevensAsked:
Who is Participating?
 
Pravin AsarConnect With a Mentor Principal Systems EngineerCommented:
var dt = new Date();
dt.setHours(dt.getHours()-1);
alert (dt.toLocaleString());

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.