phpMyEdit - Viewing Bug Advanced Details [ Go Back ]
260 core / general minor always 2004-08-24 04:49 2004-08-26 12:18
doug  
 
normal  
confirmed 5.3 (stable)  
open  
none  
none  
'datemask' => 'H:i:s', with TIME column
Perhaps this is noted, or fixed, elsewhere and I was unable to find it. Using class file:
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.143 2004/04/22 16:15:14 nepto Exp $ */
with 'datemask' => 'H:i:s' only displays an empty cell when one would expect to see something like "08:00:00" as the value.


$opts['fdd']['time_col'] = array(
'datemask' => 'H:i:s',
'default' => '00:00:00',
'input' => '',
'maxlen' => 8,
'name' => 'Time Col',
'options' => 'ACPVDFL',
'required' => true,
'select' => 'T',
'size|ACP' => 8,
'sqlw' => 'TRIM("$val_as")',
'sort' => true
);

Bug Notes
michal   
2004-08-25 12:20   
the problem is that time_col is not a datetime but a time column (?). calling unixtimestamp on it causes some problems :). i'm not sure if this is currently solved in the core class.
nepto   
2004-08-26 12:18   
Yes, I can confirm this bug.

When ['datemask'] is used, UNIX_TIMESTAMP(col_name) is used when retrieving data from DB. However UNIX_TIMESTAMP() on TIME column returns always 0.

Probably some hacks with ['sql'] can solve this.

However TIME column retrieved from DB is already in H:i:s format, you do not need to use ['datemask]. And if you want to remove seconds from the time, you can use ['mask'] = '%.5s' option.