Data::...::Dates(3pm)
π Data::...::Dates(3pm) π
okay bestie, buckle up, we're in the perl manual β this is the Data::Fake::Dates page and it's genuinely so fun. it's part of the User Contributed Perl Documentation, which is basically the fandom wiki of perl modules. π«Ά
β¨ NAME β¨
Data::Fake::Dates β fake date data generators. it makes up dates. that's the whole job. and it EATS. π
πΈ VERSION πΈ
version 0.006
π¦ SYNOPSIS π¦
the vibe check, in code:
use Data::Fake::Dates;
$past = fake_past_epoch()->();
$future = fake_future_epoch()->();
$past = fake_past_datetime()->(); # ISO-8601 UTC
$future = fake_future_datetime()->(); # ISO-8601 UTC
$past = fake_past_datetime("%Y-%m-%d")->();
$future = fake_future_datetime("%Y-%m-%d")->();
see how you call the function, and it hands you back a generator, and then you call <em>that</em> with ->() to actually get a value? it's giving double-call. it's iconic. it's the main character move. π
π DESCRIPTION π
so this module? it provides fake data generators for past and future dates and times. that's it. that's the whole thing. no cap.
and the best part: all functions are exported by default. so you don't gotta ask nicely, they just show up. π§
π FUNCTIONS π
β fake_past_epoch β
$generator = fake_past_epoch();
this hands you a generator that gives back a randomly-selected integer number of seconds between the Unix epoch and the current time. so like, somewhere between "the dawn of unix time" and "right now." throwback energy. π°οΈ
π fake_future_epoch π
$generator = fake_future_epoch();
same deal but the other direction β a randomly-selected integer number of seconds between the current time and a period as far into the future as the Unix epoch is in the past. which is like about 45 years as of 2015. it mirrors the past, it's symmetric, it's ate. β¨
π fake_past_datetime π
$generator = fake_past_datetime();
$generator = fake_past_datetime("%Y-%m-%d");
$generator = fake_past_datetime($strftime_format);
this one picks a past datetime the same way fake_past_epoch does, except it formats it into a string using FreeBSD-style strftime formats. (go check Time::Piece for the deets, iykyk.)
the default format is ISO8601 UTC "Zulu" time, and that is literally %Y-%m-%dT%TZ. π
π§ fake_future_datetime π§
$generator = fake_future_datetime();
$generator = fake_future_datetime("%Y-%m-%d");
$generator = fake_future_datetime($strftime_format);
same thing but future-flavoured: it selects a future datetime exactly like fake_future_epoch does, then formats it into a string with FreeBSD-style strftime formats. (again, Time::Piece has the receipts.)
default format? you guessed it β ISO8601 UTC "Zulu" time, aka %Y-%m-%dT%TZ. π
π AUTHOR π
David Golden <dagolden@cpan.org> β the legend. π«Ά
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2015 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page bestie, no notes, we understood the assignment. πβ¨
signing off from perl v5.38.2, dated 2024-07-24 β go forth and generate fake dates, you absolute icon ππ¦πΈ
π¦ where this page comes from
- debian trixie: libdata-fake-perl 0.006-3 Β· Apache-2.0
- ubuntu resolute: libdata-fake-perl 0.006-3 Β· Apache-2.0
- ubuntu stonking: libdata-fake-perl 0.006-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms