libapa...R::Date(3pm)

πŸ’– APR::Date β€” the manual page, but make it bestie πŸ’–

okay so this is libapa...R::Date(3pm) from the User Contributed Perl Documentation, and it's literally just Perl's lil interface to the APR date manipulating functions. she's small, she's cute, she parses your dates. periodt. πŸŽ€

✨ NAME ✨

APR::Date β€” Perl API for APR date manipulating functions 🌸

✨ Synopsis ✨

bestie here's the vibe in code form:

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 ✨

so APR::Socket provides the Perl interface to APR date manipulating functions. yes bestie, that's what it says β€” the description mentions APR::Socket and honestly? iconic of it. πŸ’…


✨ API ✨

APR::Date gives you the following functions and/or methods, and we're gonna go through every single one like the queens they are πŸ‘‘

🌈 parse_http

she parses HTTP date strings. that's her whole job and she eats every time.

$date_parsed = parse_http($date_string);

arg1: $date_string ( string )

the date string can be in one of these formats, no cap:

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 (GMT is assumed, regardless of the used timezone). like, she's assuming GMT no matter what timezone you hand her. that's just the rules πŸ¦‹

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.

⚠️ also!! if $date_parsed comes back as 0, that could mean out of range OR invalid. she does not distinguish. just so you know bestie 😭

since: 2.0.00

πŸ’‘ Remember to divide the return value by 1_000_000 if you need it in seconds. do NOT forget this. she's giving microseconds, not seconds, and mixing those up is a whole vibe check fail πŸ’€

🌈 parse_rfc

she parses 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 parse_http(). she's the chill one. she says yes more often 🫢

$date_parsed = parse_rfc($date_string);

arg1: $date_string ( string )

the date string can be in one of these formats β€” and yes, there are a LOT of them, we're listing all of them:

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 deal as her sister function. 1_000_000. write it down. actually don't, just read it again here πŸ“

✨ See Also ✨

mod_perl 2.0 documentation. go read it, bestie, she's thorough πŸ“šβœ¨

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. slay, team πŸ‘‘πŸ’–


and that's the whole page, bestie!! πŸŒˆπŸ’œ this was perl v5.42.3, dated 2026-08-20, and it's the libapa...R::Date(3pm) page from the User Contributed Perl Documentation. go forth and parse those dates, you absolute main character πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from