This topic is locked

Number to Time

11/24/2009 4:11:18 AM
PHPRunner General questions
M
monoofy author

Dears,
Is it possible to convert a numeric value to hours and minutes in the list page ?

example, 120 = 02:00:00

140 = 02:20:00
BR,

Mahmoud

J
Jane 11/24/2009

Hi,
I recommend you to use custom format on the "View as" settings dialog for this purpose:

http://www.xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm

J
jsuisman 11/25/2009



Dears,
Is it possible to convert a numeric value to hours and minutes in the list page ?

example, 120 = 02:00:00

140 = 02:20:00
BR,

Mahmoud


Hey Mahmoud,
On the editor page, double the click the variable you want to convert
Under the "View As" tab, click custom.
Enter the following code:



$value = date("g:i:s", mktime(0, $value, 0, 0, 0, 0));


Now if the variable's value is 140 it will display as 2:20:00
Good Luck,
Jarred