问题
I want to subtract 5.30 hours from a date, for example, I have a date:
Fri Jan 15 2016 00:00:00
after subtraction, it should be something like,
Thu Jan 14 2016 19:30:00
How I can achieve this. Any help will be appreciated.
回答1:
try
var date = new Date("Fri Jan 15 2016 00:00:00");
date.setHours(date.getHours()-5);
date.setMinutes(date.getMinutes()-30);
来源:https://stackoverflow.com/questions/35450110/want-to-substract-5-30-hours-from-a-date-javascript