SirChick Posted October 30, 2007 Share Posted October 30, 2007 Hey guys, I'm trying to work out how to do something like this: Say you had a number 34. Now i want to convert that to time by making it become 3 hours and 40 minutes.. in a time stamp manner.. On top of that say the number rolled above a 6 (suggesting 60 minutes) itll roll on to the next time line like: 364 becomes(36 - the 6 rolls over to the 3 so 3+1 = 4) which makes 44 is 4 hours and 4 minutes. then this would become 4 hours and 40 minutes as the hundred mark infact adds onto hour... How is this done and also put into a time stamp? Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/ Share on other sites More sharing options...
cooldude832 Posted October 30, 2007 Share Posted October 30, 2007 well considering you show no logical pattern in your number -> time no Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/#findComment-380814 Share on other sites More sharing options...
Azu Posted October 30, 2007 Share Posted October 30, 2007 Try taking a look at http://us.php.net/date Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/#findComment-381511 Share on other sites More sharing options...
AndyB Posted October 31, 2007 Share Posted October 31, 2007 Try taking a look at http://us.php.net/date Presumably only suggested as a learning resource and not intended as a serious response to the OP's question. I'm with cooldude. There's no apparent rhyme or reason to your conversions so 'programming' it is impossible. Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/#findComment-381618 Share on other sites More sharing options...
cooldude832 Posted October 31, 2007 Share Posted October 31, 2007 I talked to them a bit and the idea is the number is H(MM) +1H so 123 = 2 hours 23 minutes 343 = 4 hours 43 minutes. but numbers like 375 = 5 hours 15 minutes So yes it has no really strong path, but can be done. I told them a better way and solved it so this is technicaly solved. Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/#findComment-381619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.