hi,
i have a mysql TIME field in the format hh:mm:ss
How do I separate each value of hours, mins and secs and present them as integers so that i can make the proper calculations in PHP.
I tried strftime, strtotime, mktime but i cant make it work.
Please help.
convert time field to individual integers
Moderator: General Moderators
-
jolan_lars
- Forum Newbie
- Posts: 19
- Joined: Thu Oct 23, 2003 12:15 pm
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You can just [php_man]explode[/php_man]() the value:
Although depending what you are trying to do you may be able to get MySQL to do most of the work not PHP.
Mac
Code: Select all
$time_bits = explode(':', $time_from_db);Mac