Unix and Linux Discussions Tagged with amp |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
8,297 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,891 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,158 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
9,616 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,353 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,433 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
31,801 |
Solaris |
|
|
|
5 |
2,502 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
1,096 |
What is on Your Mind? |
|
|
|
33 |
28,836 |
Solaris |
|
|
|
2 |
3,518 |
Solaris |
|
|
|
2 |
3,361 |
IP Networking |
|
|
|
2 |
2,911 |
AIX |
|
|
|
0 |
1,490 |
Software Releases - RSS News |
|
|
|
2 |
7,299 |
Solaris |
|
|
|
2 |
2,017 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,870 |
Programming |
|
|
|
0 |
2,229 |
OS X Support RSS |
|
|
|
1 |
28,444 |
Shell Programming and Scripting |
|
|
|
0 |
1,896 |
Solaris BigAdmin RSS |
|
|
|
7 |
12,031 |
Ubuntu |
|
|
|
0 |
1,242 |
Complex Event Processing RSS News |
|
|
|
0 |
1,738 |
Cartoons for Geeks |
|
|
|
0 |
1,144 |
Software Releases - RSS News |
|
|
|
6 |
4,535 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
1,376 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
2,280 |
Cartoons for Geeks |
|
|
|
0 |
1,668 |
Complex Event Processing RSS News |
|
|
|
0 |
2,282 |
Cartoons for Geeks |
|
|
|
0 |
2,966 |
HP Server News and Podcasts RSS |
|
|
|
0 |
1,589 |
MySQL DevZone RSS |
|
|
|
5 |
6,277 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
1,608 |
Complex Event Processing RSS News |
|
|
|
3 |
5,536 |
UNIX and Linux Applications |
|
|
|
6 |
9,831 |
Solaris |
|
|
|
0 |
2,200 |
Cartoons for Geeks |
|
|
|
0 |
1,705 |
Cartoons for Geeks |
|
|
|
2 |
4,781 |
OS X (Apple) |
|
|
|
3 |
2,118 |
Shell Programming and Scripting |
|
|
|
0 |
887 |
Software Releases - RSS News |
Time::Piece::MySQL(3pm) User Contributed Perl Documentation Time::Piece::MySQL(3pm)
NAME
Time::Piece::MySQL - Adds MySQL-specific methods to Time::Piece
SYNOPSIS
use Time::Piece::MySQL;
my $time = localtime;
print $time->mysql_datetime;
print $time->mysql_date;
print $time->mysql_time;
my $time = Time::Piece->from_mysql_datetime( $mysql_datetime );
my $time = Time::Piece->from_mysql_date( $mysql_date );
my $time = Time::Piece->from_mysql_timestamp( $mysql_timestamp );
DESCRIPTION
Using this module instead of, or in addition to, "Time::Piece" adds a few MySQL-specific date-time methods to "Time::Piece" objects.
OBJECT METHODS
mysql_date / mysql_time / mysql_datetime / mysql_timestamp
Returns the date and/or time in a format suitable for use by MySQL.
CONSTRUCTORS
from_mysql_date / from_mysql_datetime / from_mysql_timestamp
Given a date, datetime, or timestamp value as returned from MySQL, these constructors return a new Time::Piece object. If the value is
NULL, they will retrun undef.
CAVEAT
"Time::Piece" itself only works with times in the Unix epoch, this module has the same limitation. However, MySQL itself handles date and
datetime columns from '1000-01-01' to '9999-12-31'. Feeding in times outside of the Unix epoch to any of the constructors has
unpredictable results.
Also, MySQL doesn't validate dates (because your application should); it only checks that dates are in the right format. So, your database
might include dates like 2004-00-00 or 2001-02-31. Passing invalid dates to any of the constructors is a bad idea: on my system the former
type (with zeros) returns undef (previous version used to die) while the latter returns a date in the following month.
AUTHOR
Original author: Dave Rolsky <autarch@urth.org>
Current maintainer: Marty Pauley <marty+perl@kasei.com>
COPYRIGHT
(c) 2002 Dave Rolsky
(c) 2004 Marty Pauley
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Time::Piece
perl v5.12.4 2008-06-07 Time::Piece::MySQL(3pm)