.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "docs::api::APR::Date 3pm" .TH docs::api::APR::Date 3pm 2024-01-10 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME APR::Date \- Perl API for APR date manipulating functions .SH Synopsis .IX Header "Synopsis" .Vb 1 \& use APR::Date (); \& \& # parse HTTP\-complient date string \& $date_string = \*(AqSun, 06 Nov 1994 08:49:37 GMT\*(Aq; \& $date_parsed = APR::Date::parse_http($date_string); \& \& # parse RFC822\-complient date string \& $date_string = \*(AqSun, 6 Nov 94 8:49:37 GMT\*(Aq; \& $date_parsed = APR::Date::parse_rfc($date_string); .Ve .SH Description .IX Header "Description" \&\f(CW\*(C`APR::Socket\*(C'\fR provides the Perl interface to APR date manipulating functions. .SH API .IX Header "API" \&\f(CW\*(C`APR::Date\*(C'\fR provides the following functions and/or methods: .ie n .SS """parse_http""" .el .SS \f(CWparse_http\fP .IX Subsection "parse_http" Parse HTTP date strings .PP .Vb 1 \& $date_parsed = parse_http($date_string); .Ve .ie n .IP "arg1: $date_string ( string )" 4 .el .IP "arg1: \f(CW$date_string\fR ( string )" 4 .IX Item "arg1: $date_string ( string )" The date string can be in one of the following formats: .Sp .Vb 3 \& Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 \& Sunday, 06\-Nov\-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 \& Sun Nov 6 08:49:37 1994 ; ANSI C\*(Aqs asctime() format .Ve .Sp refer to RFC2616 for the details (GMT is assumed, regardless of the used timezone). .ie n .IP "ret: $date_parsed ( number )" 4 .el .IP "ret: \f(CW$date_parsed\fR ( number )" 4 .IX Item "ret: $date_parsed ( number )" the number of microseconds since 1 Jan 1970 GMT, or 0 if out of range or if the date is invalid. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Remember to divide the return value by 1_000_000 if you need it in seconds. .ie n .SS """parse_rfc""" .el .SS \f(CWparse_rfc\fP .IX Subsection "parse_rfc" Parse a string resembling an RFC 822 date. It's meant to be lenient in its parsing of dates. Hence, this will parse a wider range of dates than \f(CWparse_http()\fR. .PP .Vb 1 \& $date_parsed = parse_rfc($date_string); .Ve .ie n .IP "arg1: $date_string ( string )" 4 .el .IP "arg1: \f(CW$date_string\fR ( string )" 4 .IX Item "arg1: $date_string ( string )" The date string can be in one of the following formats: .Sp .Vb 10 \& Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 \& Sunday, 06\-Nov\-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 \& Sun Nov 6 08:49:37 1994 ; ANSI C\*(Aqs asctime() format \& Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 \& Sun, 06 Nov 94 08:49:37 GMT ; RFC 822 \& Sun, 6 Nov 94 08:49:37 GMT ; RFC 822 \& Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr\e@ast.cam.ac.uk] \& Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\e@ast.cam.ac.uk] \& Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] \& Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] .Ve .ie n .IP "ret: $date_parsed ( number )" 4 .el .IP "ret: \f(CW$date_parsed\fR ( number )" 4 .IX Item "ret: $date_parsed ( number )" the number of microseconds since 1 Jan 1970 GMT, or 0 if out of range or if the date is invalid. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Remember to divide the return value by 1_000_000 if you need it in seconds. .SH "See Also" .IX Header "See Also" mod_perl 2.0 documentation. .SH Copyright .IX Header "Copyright" mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. .SH Authors .IX Header "Authors" The mod_perl development team and numerous contributors.