Drew Taylor wrote:
> In the template I wanted to take the stringified class_date object
> ("2004-10-25 09:00:00") and split on the white space to get the
> individual day and hour components. My first thought was:
> 
>   [day, time] = schedule.class_date.split(' ');
> 

What about being explicit and using strftime?

day = schedule.class_date.strftime('%Y-%m-%d')
time = schedule.class_date.strftime('%H-%M-%S') 

Also Class::Date seems an odd choice, I'm more familiar with Time::Piece.

Gavin.

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to