php-db | 2001011
Date: 01/14/01
- Next message: Roman Serbski: "[PHP-DB] MySQL+PHP charset problem"
- Previous message: Anuradha Ratnaweera: "[PHP-DB] reading boolean values from a database"
- In reply to: Chris K. Chew: "[PHP-DB] RE: Newbie Time Fields question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> A song of 6 minutes and 24 seconds:
>
> mktime(0,6,24) = 384 seconds
Whoa.. 6*60+24 makes more sense here. Your mktime() won't work at all as
it fills in the current time/date for any missing values.
> date("m:i", 384) = 6:24
This also won't work because 'm' stands for month. And it is a bad habit
to get into using mktime() and date() for stuff like this as local
timezones are really going to mess with you.
To convert 384 into 6:24 you can do:
echo (int)(384/60).':'.(384%60);
-Rasmus
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Roman Serbski: "[PHP-DB] MySQL+PHP charset problem"
- Previous message: Anuradha Ratnaweera: "[PHP-DB] reading boolean values from a database"
- In reply to: Chris K. Chew: "[PHP-DB] RE: Newbie Time Fields question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

