[Dbix-class] InflateColumn::DateTime - how to use it?

RA Jones ra.jones at dpw.clara.co.uk
Thu May 10 16:29:00 GMT 2007


Adam Herzog wrote:
> In your previous code you were doing something similar to this in your 
> controller:
> while ( my $hits = $rs->next ) {
>     push @hits, $hits->date;
> }
>
> That should fill @hits with DateTime objects. Assuming you stick @hits 
> into your stash, then in your template you can do:
>
> [% FOR hit IN hits; %]
>         Date: [% hit.dmy(); %]<br />
> [% END; %]
>
> That should display a list of all of the dates, formatted how you wanted.
>
It does, thanks, though I have a little more control over the formatting 
if I use the method suggested by mst, ie hit.strftime('%d.%m.%Y')
--
Richard Jones


**********************************************************************
This message  may  contain  confidential  and  privileged information.
If you are not  the intended  recipient please  accept our  apologies.
Please do not disclose, copy or distribute  information in this e-mail
or take any  action in reliance on its  contents: to do so is strictly
prohibited and may be unlawful. Please inform us that this message has
gone  astray  before  deleting it.  Thank  you for  your co-operation.

NHSmail is used daily by over 100,000 staff in the NHS. Over a million
messages  are sent every day by the system.  To find  out why more and
more NHS personnel are  switching to  this NHS  Connecting  for Health
system please visit www.connectingforhealth.nhs.uk/nhsmail
**********************************************************************




More information about the Dbix-class mailing list