The problem I see with doing it this way: $formatted_date_string =
 $c->model('DB::TableName')->find($row_index)->date_field->mdy('/'); is
that It looks like I would
have to do this every time I grab a date from the database.  That is fine
but there are times in my app where I pull everything from the database to
display like so:

my $things = $c->stash->{mydata_rs}->search(
        undef,
        {
                order_by => { -asc => 'uniq' },
        },
);

where each item has a timestamp of when it was created and when it was last
modified, would I have to do another search to get the datetime formatted
or worse pull them one by one building a hash_ref or array?

On Thu, Nov 3, 2011 at 6:04 AM, Tomas Doran <[email protected]> wrote:

>
> On 3 Nov 2011, at 02:05, Adam Jimerson wrote:
>
>  but in my Catalyst app the
>> date looks like this 2011-05-07T13:53:41.  The "T" instead of the space
>> is driving me crazy, I think it is coming from DateTime::Format:Pg
>>
>
> As other people have noted, what's happening is that DateTime::Format:Pg
> is parsing the dates you get out of Postgres, and handing you a DateTime
> object back.
>
> You're then printing that with no formatting, as you're basically getting
> an ISO8601 timestamp out.
>
> Have a look at the docs for DateTime and the associated
> DateTime::Format::XX things :)
>
> Cheers
> t0m
>
>
>
>
> ______________________________**_________________
> List: [email protected]
> Listinfo: 
> http://lists.scsys.co.uk/cgi-**bin/mailman/listinfo/catalyst<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst>
> Searchable archive: http://www.mail-archive.com/**
> [email protected]/<http://www.mail-archive.com/[email protected]/>
> Dev site: http://dev.catalyst.perl.org/
>
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to