HTTP::...eHeader(3pm)

πŸ’– HTTP::Headers::ActionPack::DateHeader(3pm) πŸ’–

okay bestie, welcome to the manpage for HTTP::Headers::ActionPack::DateHeader β€” yes it's a mouthful, yes it's iconic, and yes it is literally just a Date Header. That's the whole job. She's a header that holds a date. Let's get into it πŸ—“οΈβœ¨


✨ VERSION ✨

version 0.09 β€” she's serving vintage, she's been here a minute πŸ’…


🌸 SYNOPSIS 🌸

use HTTP::Headers::ActionPack::DateHeader;

# create from string
my $date = HTTP::Headers::ActionPack::DateHeader->new_from_string(
    'Mon, 23 Apr 2012 14:14:19 GMT'
);

# create using Time::Peice object
my $date = HTTP::Headers::ActionPack::DateHeader->new(
    $timepeice_object
);

two ways to make her, bestie. one from a string, one from a Time::Peice object. pick your fighter 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So. This is an object which represents an HTTP header with a date. That's it, that's the gig πŸ‘‘

What she does though? She will inflate the header value into a Time::Piece object and proxy most of the relevant methods. So you hand her a string, she hands you back a whole real time object with methods and everything. it's giving glow-up, it's giving transformation arc, we love to see it πŸ’–

🌈 DateTime compatibility

Okay so this is the part where the author explains their choices and honestly? valid.

They opted to not use DateTime (by default) for this class since it is not a core module and can be a memory hog at times. fair. respectful. we understand.

That said β€” and this is important β€” it should be noted that DateTime objects are compatible with this class. You will need to pass in a DateTime instance to new and after that everything should behave properly. ✨

And if you want new_from_string to inflate strings to DateTime objects, you will need to override that method yourself. no hand-holding here, you're on your own for that one bestie 😭 DIY era


πŸ’… METHODS πŸ’…

  • date β€” Returns the underlying Time::Piece object. that's your girl right there, the real one underneath 🌸
  • new_from_string ( $date_header_string ) β€” This will take an HTTP header Date string and parse it into and object. (yes, "and object", we're quoting the author, the vibes are immaculate and the grammar is free πŸ•ŠοΈ)
  • as_string
  • second
  • minute
  • hour
  • day_of_month
  • month_number
  • fullmonth
  • month
  • year
  • day_of_week
  • day
  • fullday
  • epoch

These delegate to the underlying Time::Piece object. 🫢 so like, every single one of them is just passing the message along to the Time::Piece underneath. she's a middlewoman and she's great at it. no cap.


πŸ‘‘ AUTHOR πŸ‘‘

Stevan Little <stevan.little@iinteractive.com>


πŸŽ€ CONTRIBUTORS πŸŽ€

  • Andrew Nelson <anelson@cpan.org>
  • Dave Rolsky <autarch@urth.org>
  • Florian Ragwitz <rafl@debian.org>
  • Jesse Luehrs <doy@tozt.net>
  • Karen Etheridge <ether@cpan.org>

the whole squad showed up, we love a collaborative effort, main character energy from every single one of them ⭐


This software is copyright (c) 2012 by Infinity Interactive, Inc.. (two periods, we're keeping it, that's canon πŸŽ€)

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source, we stan 🫢


okay and that's the whole page bestie!! this one came from the User Contributed Perl Documentation and she's living on perl v5.34.0, dated 2022-06-14 β€” so if you're reading this, that's the vintage you're sipping from πŸ“βœ¨ go forth and format your dates, ily, bye!! πŸ’–πŸŒˆπŸ’…

πŸ“¦ where this page comes from