Re: Returning A Class::Date Object
[prev]
[thread]
[next]
[Date index for 2005/01/11]
This is a multi-part message in MIME format.
--------------070403030102010603070503
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
yup - completely missed that example in the documentation! cheers matt
Matt S Trout wrote:
> On Mon, Jan 10, 2005 at 09:10:19PM +0000, Jay Hargreaves wrote:
>
>>Hi y'all!
>>
>>I have found Class::Date to be a very useful date formatting routine and
>>as such I would like to return a Class::Date object (rather than the
>>actual value) for any date fields in my database.
>>
>>Presumably it might also be a good idea to set values in the database
>>from a Class::Date object, since it has various parsing facilities
>>available.
>>
>>Can someone please tell me a good way to do this is? Do I use a trigger?
>
>
> Have a look at the inflate and deflate stuff in the Class::DBI pod, which
> expands on the following synopsis example:
>
> Music::CD->has_a(
> reldate => 'Time::Piece',
> inflate => sub { Time::Piece->strptime(shift, "%Y-%m-%d") },
> deflate => 'ymd',
> );
>
--
a: 18 hart street, altrincham, wa14 1jw
m: 07899 872 306
e: jay@xxxxxxx.xxx
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
--------------070403030102010603070503
Content-Type: text/x-vcard; charset=utf-8;
name="jay.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="jay.vcf"
begin:vcard
fn:Jay Hargreaves
n:Hargreaves;Jay
adr:;;18 Hart Street;Altrincham;;WA14 1JW;UNITED KINGDOM
email;internet:jay@xxxxxxx.xxx
tel;cell:07899 872 306
x-mozilla-html:FALSE
url:http://www.rigadon.com
version:2.1
end:vcard
--------------070403030102010603070503--