HTML::...teTime(3pm)

๐Ÿ’– NAME ๐Ÿ’–

HTML::Microformats::Datatype::DateTime โ€” it's giving dates. And datetimes. That's the whole vibe, bestie. ๐Ÿ—“๏ธโœจ

(Also hi, you're reading a page from the User Contributed Perl Documentation collection, manual section 3pm, and the module lives under HTML::Microformats::Datatype::DateTime. Slay.)


๐ŸŒธ SYNOPSIS ๐ŸŒธ

Like, the tiniest little taste of what this thing does:

my $duration = HTML::Microformats::Datatype::DateTime->now;
print "$duration\n";

Okay so you literally just asked it for now and it gave you a whole datetime back. Main character behaviour fr fr. ๐Ÿ‘‘


โœจ DESCRIPTION โœจ

This class inherits from DateTime, so every single method DateTime has? Yeah. It's got 'em. All of them. No cap. ๐Ÿซถ

๐ŸŽ€ Constructors ๐ŸŽ€

So because it inherits from DateTime, the standard DateTime constructors โ€” new, now, etc. โ€” should just work. The way that inheritance ate. ๐Ÿ’…

And then there's this extra one:

  • $dt = HTML::Microformats::Datatype::DateTime->parse($string, $elem, $context, [$tz], [$base]) โ€” Creates a new HTML::Microformats::Datatype::DateTime object. โœจ
    • $tz is the timezone to use, but only if it can't be figured out otherwise. Like, it's the backup plan timezone. ๐Ÿ•
    • $base is a base datetime to use for relative datetimes, whatever that means. (Not me being honest about the docs. ๐Ÿ™ˆ)

๐Ÿฆ‹ Public Methods ๐Ÿฆ‹

  • $d->to_string โ€” Returns a literal string. That's it. That's the method. ๐Ÿ’–
  • $d->datatype โ€” Returns an the RDF datatype URI representing the data type of this literal. Yes, "an the" โ€” we don't fix the original's grammar, we respect it. Iconic. ๐ŸŒˆ

๐Ÿ’€ BUGS ๐Ÿ’€

Please report any bugs to <http://rt.cpan.org/>. Do it. Be brave. The maintainers are literally waiting. ๐Ÿ›โžก๏ธ๐Ÿ“ฎ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

Go read these next, bestie, they're the friend group:

  • HTML::Microformats
  • HTML::Microformats::Datatype
  • DateTime

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Toby Inkster <tobyink@cpan.org>. King behaviour. ๐Ÿซก


Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. So like, go off. Do your thing. Legally. โญ


๐Ÿงš DISCLAIMER OF WARRANTIES ๐Ÿงš

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Translation: it comes with zero promises, okay?? No guarantees, no safety net, no "it'll definitely work on your machine". Take it or leave it. ๐Ÿ˜ญ (This is important, don't skip it just because I made it cute.)


perl v5.32.1 ยท 2021-09-12 ยท HTML::Microformats::Datatype::DateTime(3pm)

That's the version and the date this whole page was last touched, and that's the manual it lives in โ€” thanks for coming to my TED talk, ily, bye bestie! ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from