Add 'x' 30 mins blocks to time string (javascript)

Posted by Mikey1980 on Stack Overflow See other posts from Stack Overflow or by Mikey1980
Published on 2010-06-10T16:58:19Z Indexed on 2010/06/10 17:02 UTC
Read the original article Hit count: 227

Filed under:
|

I have a 24 hour time string (ie 16:30) and would like to add x time blocks of 30 mins. For example if x = 4, then 16:30 + 4(30) = 18:30. Is there any easy way to do this with out exploding the string and doing if statements for mins/hours.. etc? Also this is on a php page would it be easier to do this in php then echo it to the javascript?

Thanks for the help!

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript