DateTim...setOnly(3)
π NAME
Okay so bestie, gather round: DateTime::TimeZone::OffsetOnly is literally a DateTime::TimeZone object that just contains an offset. That's it. That's the whole vibe. π
β¨ VERSION
version 2.64 β iconic, no cap.
πΈ SYNOPSIS
my $offset_tz = DateTime::TimeZone->new( name => '-0300' );
Look at her go. One line. Main character energy. π
π¦ DESCRIPTION
So here's the tea β: this class exists to provide the DateTime::TimeZone API that DateTime.pm needs, but with a fixed offset. Like, frozen. Locked in. An object in this class will always return the same offset that was handed to it in its constructor β regardless of the date. No date-based glow-ups, no DST plot twists. She said "I am who I am" and honestly? Respect. π
π«Ά USAGE
This class has the same methods as a real time zone object, but the category() method returns undef. Yes, really β undef. She's mysterious like that. π
π DateTime::TimeZone::OffsetOnly->new ( offset => $offset )
The value you give to the offset parameter has got to be a string like "+0300" β that's the assignment, bestie, don't deviate. Those strings get converted into numbers by the DateTime::TimeZone::offset_as_seconds() function. Math girlie behavior. π₯
β $tz->offset_for_datetime( $datetime )
No matter what date you throw at her β literally any date β the offset you provided to the constructor is always used. Always. It's giving loyalty. π«‘
π§ $tz->name()
π§ $tz->short_name_for_datetime()
Both of these methods return the offset in string form. Two methods, one answer. Efficient queen. π
π SUPPORT
Bugs may be submitted at <https://github.com/houseabsolute/DateTime-TimeZone/issues>.
(Please be nice when you report them, ok? π₯Ί)
π SOURCE
The source code repository for DateTime-TimeZone can be found at <https://github.com/houseabsolute/DateTime-TimeZone>.
Go snoop, bestie, the code is public π
π AUTHOR
Dave Rolsky <autarch@urth.org>
Legend. Icon. The moment. π
π COPYRIGHT AND LICENSE
This software is copyright (c) 2025 by Dave Rolsky.
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.
Fr fr, read the license file β it's right there in the distribution, no excuses π
Mwah π β that's a wrap on the User Contributed Perl Documentation for DateTim...setOnly(3), shipped with perl v5.42.0 and dated 2025-01-22. Slay, go write some timezones. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-DateTime-TimeZone 2.640.0-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms