.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Atompub::DateTime 3pm" .TH Atompub::DateTime 3pm 2024-03-04 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Atompub::DateTime \- A date and time object for the Atom Publishing Protocol .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& # assuming the local timezone is JST (+09:00) \& \& use Atompub::DateTime qw(datetime); \& \& $dt = datetime; # current time \& $dt = datetime(DateTime\->new); \& $dt = datetime(1167609600); # UTC epoch value \& $dt = datetime(\*(Aq20070101090000\*(Aq); \& $dt = datetime(\*(Aq2007\-01\-01 09:00:00\*(Aq); \& $dt = datetime(\*(Aq2007\-01\-01 00:00:00Z\*(Aq); \& $dt = datetime(\*(Aq2007\-01\-01T09:00:00+09:00\*(Aq); \& $dt = datetime(\*(Aq2007\-01\-01T00:00:00Z\*(Aq); \& $dt = datetime(\*(AqMon, 01 Jan 2007 00:00:00 GMT\*(Aq); \& \& $dt\->epoch; # 1167609600 (UTC epoch value) \& $dt\->iso; # 2007\-01\-01 09:00:00 (in localtime) \& $dt\->isoz; # 2007\-01\-01 00:00:00Z \& $dt\->w3c; # 2007\-01\-01T09:00:00+09:00 \& $dt\->w3cz; # 2007\-01\-01T00:00:00Z \& $dt\->str; # Mon, 01 Jan 2007 00:00:00 GMT \& \& my $dt2 = datetime($dt); # copy \& \& $dt == $dt2; # compare \& \& "$dt"; # $dt\->w3c \& \& $dt\->dt; # DateTime object .Ve .SH METHODS .IX Header "METHODS" .ie n .SS "Atompub::DateTime\->new([ $str ])" .el .SS "Atompub::DateTime\->new([ \f(CW$str\fP ])" .IX Subsection "Atompub::DateTime->new([ $str ])" Returns a datetime object representing the time \f(CW$str\fR. If the function is called without an argument, it will use the current time. .ie n .SS "datetime([ $str ])" .el .SS "datetime([ \f(CW$str\fP ])" .IX Subsection "datetime([ $str ])" An alias for Atompub::DateTime\->new .ie n .SS $datetime\->epoch .el .SS \f(CW$datetime\fP\->epoch .IX Subsection "$datetime->epoch" Returns UTC epoch value. .PP .Vb 1 \& 1167609600 .Ve .ie n .SS $datetime\->iso .el .SS \f(CW$datetime\fP\->iso .IX Subsection "$datetime->iso" Returns a "YYYY-MM-DD hh:mm:ss"\-formatted string representing time in the local time zone. .PP .Vb 1 \& 2007\-01\-01 09:00:00 .Ve .ie n .SS $datetime\->isoz .el .SS \f(CW$datetime\fP\->isoz .IX Subsection "$datetime->isoz" Returns a "YYYY-MM-DD hh:mm:ssZ"\-formatted string representing Universal Time. .PP .Vb 1 \& 2007\-01\-01 00:00:00Z .Ve .ie n .SS $datetime\->w3c .el .SS \f(CW$datetime\fP\->w3c .IX Subsection "$datetime->w3c" Returns a "YYYY\-MM\-DDThh:mm:ssTZ"\-formatted string (W3C DateTime Format) representing time in the local time zone. .PP .Vb 1 \& 2007\-01\-01T09:00:00+09:00 .Ve .ie n .SS $datetime\->w3cz .el .SS \f(CW$datetime\fP\->w3cz .IX Subsection "$datetime->w3cz" Returns a "YYYY\-MM\-DDThh:mm:ssZ"\-formatted string (W3C DateTime Format) representing Universal Time. .PP .Vb 1 \& 2007\-01\-01T00:00:00Z .Ve .ie n .SS $datetime\->str .el .SS \f(CW$datetime\fP\->str .IX Subsection "$datetime->str" Returns a human readable representation. .PP .Vb 1 \& Mon, 01 Jan 2007 00:00:00 GMT .Ve .ie n .SS $datetime\->dt .el .SS \f(CW$datetime\fP\->dt .IX Subsection "$datetime->dt" An accessor for the internal DateTime object. .ie n .SS $datetime\->tz .el .SS \f(CW$datetime\fP\->tz .IX Subsection "$datetime->tz" An accessor for the internal DateTime::TimeZone object. .ie n .SS $datetime\->fmt .el .SS \f(CW$datetime\fP\->fmt .IX Subsection "$datetime->fmt" An accessor for the internal DateTime::Format object. .SH "INTERNAL INTERFACES" .IX Header "INTERNAL INTERFACES" .ie n .SS $datetime\->init .el .SS \f(CW$datetime\fP\->init .IX Subsection "$datetime->init" .ie n .SS $datetime\->_parse_timestamp .el .SS \f(CW$datetime\fP\->_parse_timestamp .IX Subsection "$datetime->_parse_timestamp" .SH "SEE ALSO" .IX Header "SEE ALSO" Atompub .SH AUTHOR .IX Header "AUTHOR" Takeru INOUE, .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" Copyright (c) 2007, Takeru INOUE \f(CW\*(C`\*(C'\fR. All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. .PP IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.