When I retrieve a datetime field from a mysql database, it gets a "T"
stuck in between the date and time fields of the return value (for
"Time", I assume). Is there a way to suppress this and have a space in
the field as I'm expecting? I don't see anything in the RDBO
documentation about it. Looking in the DateTime documentation it seems
that's standard for the DateTime::datetime function. I don't see anyway
of overriding it from the Rose objects though, and I've learned to ask
questions on mailing lists before I start poring through CPAN code. :)
Example:
mysql>SELECT user_name, expires from user;
+---------------------------+---------------------+
| user_name | expires |
+---------------------------+---------------------+
| [EMAIL PROTECTED] | 2006-12-21 13:59:59 |
+---------------------------+---------------------+
using this code snippet:
my $user = My::User->new(user_name => '[EMAIL PROTECTED]');
##My::User has 'use base qw(Rose::DB::Object);'
$user->load;
print $user->expires;
I get:
2006-12-21T13:59:59
Obviously, I could just s/T/ /g on any field that's a datetime in my
database, but I'd like a cleaner way that will make all datetime fields
return as they are in the mysql client.
Any ideas? I've just started with RDBO so I apologize if I've missed
something obvious or something covered in the docs.
Thanks,
Dan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object