1docs::api::APR::Date(3)User Contributed Perl Documentatiodnocs::api::APR::Date(3)
2
3
4

NAME

6       APR::Date - Perl API for APR date manipulating functions
7

Synopsis

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

Description

20       "APR::Socket" provides the Perl interface to APR date manipulating
21       functions.
22

API

24       "APR::Date" provides the following functions and/or methods:
25
26       "parse_http"
27
28       Parse HTTP date strings
29
30         $date_parsed = parse_http($date_string);
31
32       arg1: $date_string ( string )
33           The date string can be in one of the following formats:
34
35             Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
36             Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
37             Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
38
39           refer to RFC2616 for the details (GMT is assumed, regardless of the
40           used timezone).
41
42       ret: $date_parsed ( number )
43           the number of microseconds since 1 Jan 1970 GMT, or 0 if out of
44           range or if the date is invalid.
45
46       since: 2.0.00
47
48       Remember to divide the return value by 1_000_000 if you need it in sec‐
49       onds.
50
51       "parse_rfc"
52
53       Parse a string resembling an RFC 822 date.  It's meant to be lenient in
54       its parsing of dates.  Hence, this will parse a wider range of dates
55       than "parse_http()".
56
57         $date_parsed = parse_rfc($date_string);
58
59       arg1: $date_string ( string )
60           The date string can be in one of the following formats:
61
62             Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
63             Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
64             Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
65             Sun, 6 Nov 1994 08:49:37 GMT   ; RFC 822, updated by RFC 1123
66             Sun, 06 Nov 94 08:49:37 GMT    ; RFC 822
67             Sun, 6 Nov 94 08:49:37 GMT     ; RFC 822
68             Sun, 06 Nov 94 08:49 GMT       ; Unknown [drtr\@ast.cam.ac.uk]
69             Sun, 6 Nov 94 08:49 GMT        ; Unknown [drtr\@ast.cam.ac.uk]
70             Sun, 06 Nov 94 8:49:37 GMT     ; Unknown [Elm 70.85]
71             Sun, 6 Nov 94 8:49:37 GMT      ; Unknown [Elm 70.85]
72
73       ret: $date_parsed ( number )
74           the number of microseconds since 1 Jan 1970 GMT, or 0 if out of
75           range or if the date is invalid.
76
77       since: 2.0.00
78
79       Remember to divide the return value by 1_000_000 if you need it in sec‐
80       onds.
81

See Also

83       mod_perl 2.0 documentation.
84
86       mod_perl 2.0 and its core modules are copyrighted under The Apache
87       Software License, Version 2.0.
88

Authors

90       The mod_perl development team and numerous contributors.
91
92
93
94perl v5.8.8                       2006-11-19           docs::api::APR::Date(3)
Impressum