Time::M...trptime(3)
okay so bestie, welcome to Time::M...trptime(3) β the User Contributed Perl Documentation page for Time::Moment::Role::Strptime, and it is literally giving βtiny role, big strptime energyβ π
β¨
πΈ NAME πΈ
Time::Moment::Role::Strptimeβ strptime constructor for Time::Moment π«Ά
β¨ SYNOPSIS β¨
use Time::Moment;
use Role::Tiny ();
my $class = Role::Tiny->create_class_with_roles('Time::Moment', 'Time::Moment::Role::Strptime');
my $moment = $class->strptime('2019-06-01', '%Y-%m-%d');
π DESCRIPTION π
This role composes the strptime method, which parses the input string according to a strptime(3) format, and constructs a Time::Moment object. Slay.
By default the returned Time::Moment object is in UTC (possibly adjusted by a parsed offset); to interpret the parsed time in another time zone, you can use Time::Moment::Role::TimeZone:
use Time::Moment;
use Role::Tiny ();
my $class = Role::Tiny->create_class_with_roles('Time::Moment',
'Time::Moment::Role::Strptime', 'Time::Moment::Role::TimeZone');
my $moment = $class->strptime($input, $format)->with_system_offset_same_local;
use DateTime::TimeZone::Olson 'olson_tz';
my $tz = olson_tz('America/Los_Angeles');
my $moment = $class->strptime($input, $format)->with_time_zone_offset_same_local($tz);
π¦ METHODS π¦
π« strptime
my $moment = $class->strptime($input, $format);
Parses the input string according to the strptime(3) format, and returns a Time::Moment object in UTC. Throws an exception on parsing or out-of-bounds errors. No cap, that part is important π
Currently, Time::Piece is used to implement strptime portably, but this is considered an implementation detail β do not make it your whole main character, iykyk.
π BUGS π
Report any issues on the public bugtracker. Bestie, if something is acting up, that is the spot π
π AUTHOR π
Dan Book <dbook@cpan.org> π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2019 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
π SEE ALSO π
- Time::Moment β
and thatβs the whole vibe check: this page came from perl v5.42.2, dated 2026-02-15 β periodt π
β¨
π¦ where this page comes from
- alpine 3.24: perl-time-moment-role-strptime-doc 0.001-r1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms