Mail::M...d::Date(3)

πŸŽ€ NAME πŸŽ€

Mail::Message::Field::Date β€” message header field with uris. (yes bestie, the original description literally says "uris", we are not editing that, we respect the source πŸ’…)

Oh also β€” the top of this page calls itself Mail::M...d::Date(3) because the manpage header truncates long names. It's really Mail::Message::Field::Date(3). Mystery solved, you're welcome πŸ•΅οΈβ€β™€οΈβœ¨


πŸ¦‹ INHERITANCE πŸ¦‹

okay so the whole family tree, no cap:

Mail::Message::Field::Date
  is a Mail::Message::Field::Structured
  is a Mail::Message::Field::Full
  is a Mail::Message::Field
  is a Mail::Reporter

she's got main character energy and also four ancestors. iconic.


✨ SYNOPSIS ✨

here's the vibe, literally the whole point:

my $f = Mail::Message::Field->new(Date => time);
my $f = Mail::Message::Field::Date->new(Date => time);
my $date = $f->date;    # cleaned-up and validated
my $time = $date->time; # converted to POSIX time

you make a field, you get a cleaned-up and validated date back, and then you can turn that date into POSIX time. that's it. that's the post. 🫢


πŸ’– DESCRIPTION πŸ’–

okay so real talk: dates are a little more tricky than it should be. like, genuinely. the formatting permits a few constructs more than other RFCs use for timestamps. for instance β€” and this is the fun part β€” a small subset of timezone abbreviations are permitted. so there's wiggle room. πŸ™ˆ

the studied date field will reformat the content into a standard form. so it reads your chaotic little date and gives you back something standardized. glow-up behavior fr fr.

extends "DESCRIPTION" in Mail::Message::Field::Structured.


🌈 OVERLOADED 🌈

extends "OVERLOADED" in Mail::Message::Field::Structured.

  • overload: "" stringification β€” inherited, see "OVERLOADED" in Mail::Message::Field::Full
  • overload: '""' stringification β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: '0+' numification β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: '<='> numeric comparison β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: bool boolean β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: cmp string comparison β€” inherited, see "OVERLOADED" in Mail::Message::Field

(yes, there are two stringification entries and they are slightly different. we do not question the ancestors. 🧚)


πŸ”₯ METHODS πŸ”₯

extends "METHODS" in Mail::Message::Field::Structured.

🌸 Constructors 🌸

extends "Constructors" in Mail::Message::Field::Structured.

  • $obj->clone() β€” inherited, see "Constructors" in Mail::Message::Field
  • $class->from($field, %options) β€” inherited, see "Constructors" in Mail::Message::Field::Full
  • $class->new($data) β€” inherited, see "METHODS" in Mail::Message::Field::Structured

and here's the options table, keep up bestie, every single one:

 -Option    --Defined in                      --Default
  attributes  Mail::Message::Field::Structured  <ignored>
  charset     Mail::Message::Field::Full        undef
  datum       Mail::Message::Field::Structured  undef
  encoding    Mail::Message::Field::Full        'q'
  force       Mail::Message::Field::Full        false
  language    Mail::Message::Field::Full        undef
  • attributes => \@attributes|\%attributes
  • charset => $charset
  • datum => $date
  • encoding => 'q'|'Q'|'b'|'B'
  • force => BOOLEAN
  • language => $language

Β» example:

my $mmfd = 'Mail::Message::Field::Date';
my $f = $mmfd->new(Date => time);

⭐ Attributes ⭐

extends "Attributes" in Mail::Message::Field::Structured.

  • $obj->Name() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->body() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->folded() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->foldedBody( [$body] ) β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->name() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->unfoldedBody( [$body, [$wrap]] ) β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->wellformedName( [STRING] ) β€” inherited, see "Attributes" in Mail::Message::Field

πŸ¦‹ The field πŸ¦‹

extends "The field" in Mail::Message::Field::Structured.

  • $any->isStructured( [$name] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->length() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->nrLines() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->print( [$fh] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->size() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->string( [$wrap] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->toDisclose() β€” inherited, see "The field" in Mail::Message::Field

πŸ’œ Access to the body πŸ’œ

extends "Access to the body" in Mail::Message::Field::Structured.

  • $obj->decodedBody(%options) β€” inherited, see "Access to the body" in Mail::Message::Field::Full

πŸŽ€ Access to the content πŸŽ€

extends "Access to the content" in Mail::Message::Field::Structured.

  • $obj->addAttribute(...) β€” attributes are not supported for date fields. nope, not a thing, don't try it.
  • $obj->addresses() β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->attrPairs() β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->attribute( $object|<STRING, %options>|<$name,$value,%options> ) β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->attributes() β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->beautify() β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $obj->comment( [STRING] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $any->createComment(STRING, %options) β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $any->createPhrase(STRING, %options) β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $obj->date() β€” the validated and standardized date representation for this field. and if the body of this field is not recognized? then this returns undef. sad but honest. 😭
  • $any->dateToTimestamp(STRING) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $any->stripCFWS( [STRING] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->study() β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->time() β€” convert date into a timestamp, as produced with POSIX::time().
  • $any->toDate( [$time] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->toInt() β€” inherited, see "Access to the content" in Mail::Message::Field

🧚 Internals 🧚

extends "Internals" in Mail::Message::Field::Structured.

  • $any->decode(STRING, %options) β€” inherited, see "Internals" in Mail::Message::Field::Full
  • $obj->encode(STRING, %options) β€” inherited, see "Internals" in Mail::Message::Field::Full

πŸ“ Parsing πŸ“

extends "Parsing" in Mail::Message::Field::Structured.

  • $obj->consume( $line | <$name,<$body|$objects>> ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $any->consumeComment(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->consumeDotAtom(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $any->consumePhrase(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->datum( [$value] ) β€” inherited, see "Parsing" in Mail::Message::Field::Structured
  • $obj->defaultWrapLength( [$length] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $any->fold( $name, $body, [$maxchars] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->parse(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->produceBody() β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->setWrapLength( [$length] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->stringifyData(STRING|ARRAY|$objects) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->unfold(STRING) β€” inherited, see "Parsing" in Mail::Message::Field

😭 Error handling 😭

extends "Error handling" in Mail::Message::Field::Structured.

  • $obj->AUTOLOAD() β€” inherited, see "Error handling" in Mail::Reporter
  • $obj->notImplemented() β€” inherited, see "Error handling" in Mail::Reporter

πŸ’… Cleanup πŸ’…

extends "Cleanup" in Mail::Message::Field::Structured.

  • $obj->DESTROY() β€” inherited, see "Cleanup" in Mail::Reporter

πŸ‘‘ DETAILS πŸ‘‘

extends "DETAILS" in Mail::Message::Field::Structured.

(she's giving "the details are in the parent class" and honestly? valid.)


πŸ’€ DIAGNOSTICS πŸ’€

  • Error: class $package does not implement method $method. fatal error: the specific $package (or one of its superclasses) does not implement this method where it should. this message means that some other related classes do implement this method however the class at hand does not. probably you should investigate this and probably inform the author of the package. cast by notImplemented()
  • Warning: field content is not numerical: $content the numeric value of a field is requested (for instance the Lines or Content-Length fields should be numerical), however the data contains weird characters. cast by toInt()
  • Error: field name too long (max $count), in '$name'. it is not specified in the RFCs how long a field name can be, but at least it should be a few characters shorter than the line wrap. cast by fold()
  • Warning: illegal character in charset '$name'. the field is created with an utf8 string which only contains data from the specified character set. however, that character set can never be a valid name because it contains characters which are not permitted. cast by encode()
  • Warning: illegal character in field name $name. a new field is being created which does contain characters not permitted by the RFCs. using this field in messages may break other e-mail clients or transfer agents, and therefore mutulate or extinguish your message. so maybe don't? cast by consume()
  • Warning: illegal character in language '$name'. the field is created with data which is specified to be in a certain language, however, the name of the language cannot be valid: it contains characters which are not permitted by the RFCs. cast by encode()
  • Warning: illegal encoding '$name', using 'q'. the RFCs only permit base64 (b or B ) or quoted-printable (q or Q) encoding. other than these four options are illegal. cast by encode()
  • Error: no attributes for date fields. it is not possible to add attributes to date fields: it is not permitted by the RFCs. cast by addAttribute()

🌟 SEE ALSO 🌟

this module is part of Mail-Message version 4.04, built on February 04, 2026. website: http://perl.overmeer.net/CPAN/


πŸ“œ LICENSE πŸ“œ

for contributors see file ChangeLog.

this software is copyright (c) 2001-2026 by Mark Overmeer.

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 one shipped as perl v5.42.0 on 2026-02-05, under the truncated header name Mail::M...d::Date(3) β€” she's iconic, she's a date field, and she will absolutely reformat your timestamps into something standard. periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from