docs::a...R::Date(3)
π NAME π
Okay so this is the docs::a...R::Date(3) page from User Contributed Perl Documentation, and the NAME is giving: APR::Date β Perl API for APR date manipulating functions. Periodt. π
β¨ Synopsis β¨
Here's the vibe check in code form, bestie:
use APR::Date ();
# parse HTTP-complient date string
$date_string = 'Sun, 06 Nov 1994 08:49:37 GMT';
$date_parsed = APR::Date::parse_http($date_string);
# parse RFC822-complient date string
$date_string = 'Sun, 6 Nov 94 8:49:37 GMT';
$date_parsed = APR::Date::parse_rfc($date_string);
πΈ Description πΈ
Okay so the page literally says APR::Socket provides the Perl interface to APR date manipulating functions β yes, APR::Socket, not me making a typo, that's what's written. Keeping it exactly, no cap. π
π¦ API π¦
APR::Date provides the following functions and/or methods:
π parse_http π
Parse HTTP date strings β that's the whole assignment.
$date_parsed = parse_http($date_string);
- arg1:
$date_string( string ) β the date string can be in one of the following formats, bestie:
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's asctime() format
refer to RFC2616 for the details β and GMT is assumed, regardless of the used timezone. That part is lowkey important. π«Ά
- 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. - since:
2.0.00
Remember to divide the return value by 1_000_000 if you need it in seconds. Friendly reminder, not me being dramatic. π
π parse_rfc π
Parse a string resembling an RFC 822 date. It's meant to be lenient in its parsing. Hence, this will parse a wider range of dates than parse_http(). It's giving accepting and flexible, fr fr.
$date_parsed = parse_rfc($date_string);
- arg1:
$date_string( string ) β the date string can be in one of the following formats:
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's 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\@ast.cam.ac.uk]
Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\@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]
- 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. - since:
2.0.00
Remember to divide the return value by 1_000_000 if you need it in seconds. Same note, same energy. π
π See Also π
mod_perl 2.0 documentation. That's it. Short and iconic. π
π Copyright π
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
π Authors π
The mod_perl development team and numerous contributors. Obsessed with them, tbh. π«Ά
Okay bye bestie π«Ά β this page is from perl v5.42.3, dated 2023-10-21, and it's the docs::a...R::Date(3) page. No cap, that's the whole footer vibes. π
π¦ where this page comes from
- nixos 26.05: mod_perl 2.0.13
- nixpkgs unstable: mod_perl 2.0.13
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms