1DateTime::Format::EpochU:s:eUrniCxo(n3t)ributed Perl DocDuamteenTtiamtei:o:nFormat::Epoch::Unix(3)
2
3
4
6 DateTime::Format::Epoch::Unix - Convert DateTimes to/from Unix epoch
7 seconds
8
10 use DateTime::Format::Epoch::Unix;
11
12 my $dt = DateTime::Format::Epoch::Unix->parse_datetime( 1051488000 );
13 # 2003-04-28T00:00:00
14
15 DateTime::Format::Epoch::Unix->format_datetime($dt);
16 # 1051488000
17
18 my $formatter = DateTime::Format::Epoch::Unix->new();
19 my $dt2 = $formatter->parse_datetime( 1051488000 );
20 $formatter->format_datetime($dt2);
21
23 This module can convert a DateTime object (or any object that can be
24 converted to a DateTime object) to the number of seconds since the Unix
25 epoch.
26
28 Most of the methods are the same as those in DateTime::Format::Epoch.
29 The only difference is the constructor.
30
31 • new()
32
33 Constructor of the formatter/parser object. It has no parameters.
34
36 Support for this module is provided via the datetime@perl.org email
37 list. See http://lists.perl.org/ for more details.
38
40 Eugene van der Pijll <pijll@gmx.net>
41
43 Copyright (c) 2003 Eugene van der Pijll. All rights reserved. This
44 program is free software; you can redistribute it and/or modify it
45 under the same terms as Perl itself.
46
48 DateTime
49
50 datetime@perl.org mailing list
51
52
53
54perl v5.38.0 2023-07-20 DateTime::Format::Epoch::Unix(3)