PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm receiving a string that comes in the format of "9:4". Leading zeroes are not printed on the hour format. Trailing zeroes are not shown either. echo'ing the string is only good when the minute does not end in a 0, since it doesn't show. I tried using:
Where weather[0] is equal to 9:4. I'm sure this wouldn't work, but I thought I would try before I came here anyways. Is there way to convert 9:4 to a date object somehow?
this this script add you the 0 before the number but to complete it you'd have to tell if 9:4 means 9 hours 4 minutes or 9 minutes 4 seconds, and explain if the time format you need is 00:00:00.....adn if the time format you need is in 24 format or 12 am/pm format
Thanks a lot for the help. Let me explain it a little better though. 9:4 actually means 9:40. And I was looking to display it in 12hr ampm format. 9:40am. Thanks
I realized that ampm format wouldn't be possible unless the string I received was in 24 hour format. Anyways, I changed the code around a bit and it works to suit my needs now.