[TYPO3-dev] tranforming variables to time(int(11)) values

Christian Hensel christian.hensel at gmx.net
Tue Jun 26 22:47:43 CEST 2007


   list($starthour, $startminute) = explode(":",
$this->piVars['starttime']);
   $endtime = $endhour * 60 * 60 +  $endminute * 60;

that made it..
"Christian Hensel" <christian.hensel at gmx.net> schrieb im Newsbeitrag 
news:mailman.1.1182882709.23050.typo3-dev at lists.netfielders.de...
> Hi List,
>
> i have created a little frontend extension for a page, with whom you could
> easily insert a new cal event entry.
> But Im having little Problems with start_time and end_time. because i 
> don't
> really know how to transform the entered time like
> 13:46 --> into that numberstring that is expected to be stored in the db.
> Anyone got a hint for me how to
> transform it to --> numberstring
> and to re transform from numberstring --> to humanreadable time.
>
> i thought i got it working by:
>   list($endhour, $endminute) = explode(":", $this->piVars['endtime']);
>   $tempendtime = ''.$endhour.'.'.$endminute.'';
>   $starttime =  $tempstarttime * 60 * 60;
>
> but does only work for full times like 13:00 and 14:00.
> 14:45 will be wrong.
> So anyone got a hint for me?
>
> Think that might be a dummy question, but i don't really know at the 
> moment
>
> regards Christian
>
> 






More information about the TYPO3-dev mailing list