How can I subtract hours from a HH:MM AM time string in Javascript?

Viewed 24497

What's the best way to subtract a few hours from a time string formatted as such:

8:32 AM

I thought about splitting the string at the colon but when subtracting 3 hours from, say, 1:00 AM I get -2:00 AM instead of the desired 10:00 PM.

7 Answers
Related