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? Quote 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 Quote 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 Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/75296-converting-integers-into-time/#findComment-381619 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.