Email::Date(3pm)
π Email::Date β like, the whole vibe π
okay bestie, welcome to Email::Date, a page from the User Contributed Perl Documentation section of the manual (that's the 3pm part, iykyk). It's literally called Find and Format Date Headers and honestly? It does exactly what it says on the tin. No cap. β¨
πΈ VERSION πΈ
This is version 1.104. Periodt.
π SYNOPSIS π
here's the whole thing in action, bestie, look at it go:
use Email::Date;
my $email = join '', <>;
my $date = find_date($email);
print $date->ymd;
my $header = format_date($date->epoch);
Email::Simple->create(
header => [
Date => $header,
],
body => '...',
);
like. it's giving effortless. π
π¦ DESCRIPTION π¦
Achtung! β οΈ Heads up, babe β you'll probably be fine just usingEmail::Date::Formatto produce dates, orDate::Parseto parse them. This module isn't much needed anymore, but it does still providefind_date, which we'll get into below. π
so. RFC 2822 defines the Date: header. It declares that header a required part of an email message β required!! The syntax for date headers is, like, clearly laid out and everything. But still (and yes the original says "Stil", we're keeping that typo, it's iconic π) β even a perfectly planned world has storms. π
The truth is: many programs get it wrong. Very wrong. Or they just... don't include a Date: header at all. π Which then forces you to go looking elsewhere for the date and hoping you find something. Hoping!! the audacity.
For this reason, the tedious process of looking for a valid date has been encapsulated in this software. π«Ά And further β the process of creating RFC compliant date strings is also found in here too. We love a two-for-one.
β¨ FUNCTIONS β¨
π find_date
my $time_piece = find_date $email;
find_date accepts an email message in any format Email::Abstract can understand. It looks through the email message and finds a date, converting it to a Time::Piece object.
If it can't find a date, it returns false. (sad, but valid π₯²)
find_date is exported by default. slay.
π format_date
my $date = format_date; # now
my $date = format_date( time - 60*60 ); # one hour ago
format_date accepts an epoch value, such as the one returned by time. It returns a string representing the date and time of the input, as specified in RFC 2822. If no input value is provided, the current value of time is used. π
format_date is exported by default. also slay.
π format_gmdate
my $date = format_gmdate;
format_gmdate is identical to format_date, but it will return a string indicating the time in Greenwich Mean Time, rather than local time. π timezone girlie behaviour.
format_gmdate is exported on demand, but not by default. so you gotta ask for it, bestie.
π AUTHORS π
- Casey West
- Ricardo SIGNES <rjbs@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2004 by Casey West.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie π«Ά this was Email::Date(3pm) from perl v5.36.0, dated 2022-11-27 β tysm for reading, mwah, go format some dates πβ¨π
π¦ where this page comes from
- debian bookworm: libemail-date-perl 1.104-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libemail-date-perl 1.104-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libemail-date-perl 1.104-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libemail-date-perl 1.104-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libemail-date-perl 1.104-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms