1No::Worries::Date(3) User Contributed Perl Documentation No::Worries::Date(3)
2
3
4
6 No::Worries::Date - date handling without worries
7
9 use No::Worries::Date qw(date_parse date_stamp date_string);
10
11 $string = date_stamp();
12 # e.g. 2012/04/12-11:01:42
13
14 $string = date_string(time());
15 # e.g. 2012-04-12T09:01:42Z
16
17 $string = date_string(Time::HiRes::time());
18 # e.g. 2012-04-12T09:01:42.48602Z
19
20 $time = date_parse("Sun, 06 Nov 1994 08:49:37 GMT");
21
23 This module eases date handling by providing convenient wrappers around
24 standard date functions. All the functions die() on error.
25
26 The strings and times may include fractional seconds like in the
27 example above.
28
29 date_parse() can accept many more formats than simply what date_stamp()
30 and date_string() return.
31
33 This module provides the following functions (none of them being
34 exported by default):
35
36 date_parse(STRING)
37 parse the given string and return the corresponding numerical time
38 (i.e. the number of non-leap seconds since the epoch) or an error;
39 HTTP::Date's str2time() is used for the parsing
40
41 date_stamp([TIME])
42 convert the given numerical time (or the current time if not given)
43 to a human friendly, compact, local time string
44
45 date_string([TIME])
46 convert the given numerical time (or the current time if not given)
47 to a standard, ISO 8601 compliant, UTC based string
48
50 HTTP::Date, No::Worries.
51
53 Lionel Cons <http://cern.ch/lionel.cons>
54
55 Copyright (C) CERN 2012-2019
56
57
58
59perl v5.36.0 2022-07-22 No::Worries::Date(3)