On 02/04/2010 06:55 AM, hemanth reddy wrote:
> Hi
> *
> *
> 
> *[% close_time="2000/12/21 4:20:36" %]
> 
> how to covert close_time to number of seconds since epoch
> 
> 
> can i do it using [%USE Date%]?

No. But you can do it using Template::Plugin::DateTime (which you can
get from CPAN[1]).

[% USE close_time_dt = DateTime(from_string => "2000/12/21 4:20:36",
                                pattern => '%Y/%m/%d %H:%M:%S');
   close_time_dt.epoch %]

hth,

Dave...

[1] See http://search.cpan.org/dist/Template-Plugin-DateTime/

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to