JavaSc...S::Date(3pm)

πŸ“¦
version 0.21 Β· 5 versions
, in ubuntu stonking

πŸ’– 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() and setYear() 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