Re: [Templates] mysql date parsing

[prev] [thread] [next] [Date index for 2004/07/01]

From: Mark Mills
Subject: Re: [Templates] mysql date parsing
Date: 18:54 on 01 Jul 2004
Dennis Daupert wrote:

>>man Template::Plugin::Date
>># specify time as seconds since epoch or 'h:m:s d-m-y' string
>>    
>>
>
>It looks like we've gone all around the horn on this one :-)
>
>Mysql writes his timestamps in "mysql" notation. My original
>question was whether there's a plugin or some simple macro
>code that can humanize mysql's notation. It looks like
>Template::Plugin::Date is not the way to go, since mysql
>doesn't store timestamps in unix seconds.
>
>I have a longer look at Time::Piece::MySQL, then.
>
>  
>
Actually, if you read the docs, you'll discover that it DOES store the 
timestamp in unix seconds. What it doesn't do it emit the raw unix 
time... and the UNIX_TIMESTAMP wrapped around it quite simply dumps the 
raw integer value of the timestamp.

Mysql _is_ humanizing that timestamp... into a horrible, horrible 
notation. :)

Still, I can tell you that you should never patch in code what you can 
solve in SQL. Select the unix timestamp and feed it to the standard 
plugin and you'll not have to depend on YetAnotherModule. Plus, since 
the Date plugin works fine for the Date and Datetime fieldtypes in mysql 
you'll be using it elsewhere and sooner or later you'll cross the 
streams and it'll blow up on you.

The way to fix the output of SQL is with SQL. Its a reporting 
language... that is its job.

--mark

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

Re: [Templates] mysql date parsing
Dennis Daupert 13:52 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 15:42 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 16:48 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 17:56 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 18:38 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 18:54 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 20:00 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 20:17 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Fowler 10:06 on 15 Jul 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52