table of contents
- Tumbleweed 0.100.0-1.1
- Leap-15.6
| HTTP::Headers::ActionPack::DateHeader(3) | User Contributed Perl Documentation | HTTP::Headers::ActionPack::DateHeader(3) |
NAME¶
HTTP::Headers::ActionPack::DateHeader - A Date Header
VERSION¶
version 0.10
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
);
DESCRIPTION¶
This is an object which represents an HTTP header with a date. It will inflate the header value into a Time::Piece object and proxy most of the relevant methods.
DateTime compatibility¶
I 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. That said, 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. If you want "new_from_string" to inflate strings to DateTime objects you will need to override that method yourself.
METHODS¶
- "date"
- Returns the underlying Time::Piece object.
- "new_from_string ( $date_header_string )"
- This will take an HTTP header Date string and parse it into and object.
- "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.
SUPPORT¶
Bugs may be submitted at <https://github.com/sartak/http-headers-actionpack/issues>.
SOURCE¶
The source code repository for HTTP-Headers-ActionPack can be found at <https://github.com/sartak/http-headers-actionpack>.
AUTHORS¶
- Stevan Little <stevan@cpan.org>
- Dave Rolsky <autarch@urth.org>
- Robert Rothenberg <perl@rhizomnic.com>
COPYRIGHT AND LICENSE¶
This software is copyright (c) 2012 - 2026 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
The full text of the license can be found in the LICENSE file included with this distribution.
| 2026-11-08 | perl v5.44.0 |