Jump to content

Recommended Posts

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

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.