Atompu...ateTime(3pm)
โจ NAME โจ
Atompub::DateTime โ bestie, it's a date and time object for the Atom Publishing Protocol ๐
(also hi, this is <pink>Atompub::DateTime(3pm)</pink> from the User Contributed Perl Documentation, aka the perl fam's corner of the manual โ pull up a chair ๐ซถ)
๐ฆ SYNOPSIS ๐ฆ
like, imagine your local timezone is JST (+09:00), ok? watch this โจ
# 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('20070101090000');
$dt = datetime('2007-01-01 09:00:00');
$dt = datetime('2007-01-01 00:00:00Z');
$dt = datetime('2007-01-01T09:00:00+09:00');
$dt = datetime('2007-01-01T00:00:00Z');
$dt = datetime('Mon, 01 Jan 2007 00:00:00 GMT');
$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
okay the way it just eats every single timestamp format you throw at it?? iconic. stringify it and it gives you $dt->w3c for free, no cap ๐
๐ METHODS ๐
๐ธ Atompub::DateTime->new([ $str ])
Hands you back a datetime object holding the time from $str. Call it with no argument at all and it's like "bet, we're doing now" โ it uses the current time โฐ
๐ธ datetime([ $str ])
An alias for Atompub::DateTime->new. same thing, shorter name, main character energy ๐
๐ธ $datetime->epoch
Returns the UTC epoch value. look at her:
1167609600
๐ธ $datetime->iso
Returns a "YYYY-MM-DD hh:mm:ss"-formatted string representing the time in the local time zone ๐
2007-01-01 09:00:00
๐ธ $datetime->isoz
Returns a "YYYY-MM-DD hh:mm:ssZ"-formatted string representing Universal Time ๐
2007-01-01 00:00:00Z
๐ธ $datetime->w3c
Returns a "YYYY-MM-DDThh:mm:ssTZ"-formatted string (that's the W3C DateTime Format, periodt) representing the time in the local time zone ๐
2007-01-01T09:00:00+09:00
๐ธ $datetime->w3cz
Returns a "YYYY-MM-DDThh:mm:ssZ"-formatted string (W3C DateTime Format again) representing Universal Time ๐
2007-01-01T00:00:00Z
๐ธ $datetime->str
Returns a human readable representation, for when you want it to look cute instead of computery ๐ฅบ
Mon, 01 Jan 2007 00:00:00 GMT
๐ธ $datetime->dt
An accessor for the internal DateTime object. it's right there, bestie ๐ซถ
๐ธ $datetime->tz
An accessor for the internal DateTime::TimeZone object ๐ฐ๏ธ
๐ธ $datetime->fmt
An accessor for the internal DateTime::Format object ๐
๐ฎ INTERNAL INTERFACES ๐ฎ
these are the backstage bits, not your business unless you're doing surgery ๐
$datetime->init$datetime->_parse_timestamp
๐ SEE ALSO ๐
Atompub
๐ AUTHOR ๐
Takeru INOUE, <takeru.inoue _ gmail.com> โ thank you king ๐ซก๐
๐ LICENCE AND COPYRIGHT ๐
Copyright (c) 2007, Takeru INOUE "<takeru.inoue _ gmail.com>". All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic ๐
๐ DISCLAIMER OF WARRANTY ๐
okay so this part is in all caps and it means business, so I'm giving it to you exactly how it is, no edits, no vibes, just โจlawโจ:
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.
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.
fr fr, use it responsibly bestie ๐
and that's the whole page!! this one's perl v5.40.1, dated 2025-08-14, and it lives in the manual as Atompu...ateTime(3pm) โ slay ๐โจ๐๐ฆ
๐ฆ where this page comes from
- ubuntu resolute: libatompub-perl 0.3.7-7 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libatompub-perl 0.3.7-7 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms