how would I use php to convert a number into a timestamp (specifically minutes)?
i’m using timestamps in my database, for example 00:01:30 and 00:00:30
but the people i’m writing this for have the habit (and requested) that they just are able to enter 30 or 60 or 75. on my end, i need to somehow convert these to 00:00:30, 00:01:00 and 00:01:15 respectively.
how would i go about doing this? i know about strtotime() and date() but I can’t seem to figure out how to take the number and convert it…
thanks
You can use one trick to easily convert such int to time:
This works, because gmdate will always convert seconds from
1970-01-01 00:00:00, so it wil produce correct result for all integers below 86400