JavaSc...S::Date(3pm)
π NAME π
JavaScript::QuickJS::Date β it's literally a JavaScript Date but living its best life in Perl ποΈβ¨ (yes, from the JavaScript::QuickJS family, iykyk)
β¨ SYNOPSIS β¨
okay so here's the vibe:
my $date = JavaScript::QuickJS->new()->eval("new Date()");
binmode \*STDOUT, ':encoding(utf-8)';
print $date->toISOString();
that's it. that's the whole flex. π«Ά
πΈ DESCRIPTION πΈ
This class is a JavaScript Date instance but, like, in Perl. Bestie it's the same thing you already know from the browser, just chillin' in your Perl script.
The MDN docs for it live at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date if you wanna go read the lore π
important bestie!! π¨ this class is not instantiated directly. You do not call JavaScript::QuickJS::Date->new() yourself, no ma'am. It just shows up when JavaScript hands you a Date. Don't fight it, accept the gift π
π METHODS π
Every single one of these corresponds to its JavaScript equivalent, no cap. Same names, same energy, same behavior. β
- Getters β the "tell me things" girlies π
getFullYear(),getMonth(),getDate(),getHours(),getMinutes(),getSeconds(),getMilliseconds(),getDay()- UTC variants of all of the above:
getUTCFullYear(),getUTCMonth(),getUTCDate(),getUTCHours(),getUTCMinutes(),getUTCSeconds(),getUTCMilliseconds(),getUTCDay() - Stringification squad:
toString(),toUTCString(),toGMTString(),toISOString(),toDateString(),toTimeString(),toLocaleString(),toLocaleDateString(),toLocaleTimeString(),toJSON() getTime(),getTimezoneOffset()
- Setters β the "okay but change it" girlies π
setFullYear(),setMonth(),setDate(),setHours(),setMinutes(),setSeconds(),setMilliseconds()- UTC variants of all of the above:
setUTCFullYear(),setUTCMonth(),setUTCDate(),setUTCHours(),setUTCMinutes(),setUTCSeconds(),setUTCMilliseconds()
NB:getYear()andsetYear()are omitted by design. Not an accident, not a bug, not a "oops we forgot" moment β they're just not here. Periodt. π
and that's the whole page, bestie π this little drop shipped as part of the User Contributed Perl Documentation for perl v5.42.3, dated 2026-08-19. Slay, go forth, and format your dates responsibly ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: libjavascript-quickjs-perl 0.21-3build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms