1docs::api::APR::Date(3)User Contributed Perl Documentatiodnocs::api::APR::Date(3)
2
3
4
6 APR::Date - Perl API for APR date manipulating functions
7
9 use APR::Date ();
10
11 # parse HTTP-complient date string
12 $date_string = 'Sun, 06 Nov 1994 08:49:37 GMT';
13 $date_parsed = APR::Date::parse_http($date_string);
14
15 # parse RFC822-complient date string
16 $date_string = 'Sun, 6 Nov 94 8:49:37 GMT';
17 $date_parsed = APR::Date::parse_rfc($date_string);
18
20 "APR::Socket" provides the Perl interface to APR date manipulating
21 functions.
22
24 "APR::Date" provides the following functions and/or methods:
25
26 "parse_http"
27 Parse HTTP date strings
28
29 $date_parsed = parse_http($date_string);
30
31 arg1: $date_string ( string )
32 The date string can be in one of the following formats:
33
34 Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
35 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
36 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
37
38 refer to RFC2616 for the details (GMT is assumed, regardless of the
39 used timezone).
40
41 ret: $date_parsed ( number )
42 the number of microseconds since 1 Jan 1970 GMT, or 0 if out of
43 range or if the date is invalid.
44
45 since: 2.0.00
46
47 Remember to divide the return value by 1_000_000 if you need it in
48 seconds.
49
50 "parse_rfc"
51 Parse a string resembling an RFC 822 date. It's meant to be lenient in
52 its parsing of dates. Hence, this will parse a wider range of dates
53 than "parse_http()".
54
55 $date_parsed = parse_rfc($date_string);
56
57 arg1: $date_string ( string )
58 The date string can be in one of the following formats:
59
60 Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
61 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
62 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
63 Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
64 Sun, 06 Nov 94 08:49:37 GMT ; RFC 822
65 Sun, 6 Nov 94 08:49:37 GMT ; RFC 822
66 Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
67 Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
68 Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
69 Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
70
71 ret: $date_parsed ( number )
72 the number of microseconds since 1 Jan 1970 GMT, or 0 if out of
73 range or if the date is invalid.
74
75 since: 2.0.00
76
77 Remember to divide the return value by 1_000_000 if you need it in
78 seconds.
79
81 mod_perl 2.0 documentation.
82
84 mod_perl 2.0 and its core modules are copyrighted under The Apache
85 Software License, Version 2.0.
86
88 The mod_perl development team and numerous contributors.
89
90
91
92perl v5.32.1 2021-01-26 docs::api::APR::Date(3)