JE::Object::Date(3pm)

πŸ“¦
version 0.066 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

JE::Object::Date πŸ’– the JavaScript Date object, but make it Perl

okay bestie, you found the man page for JE::Object::Date, part of the JE Perl distribution (that's the JE::Object::Date(3pm) page, in case the header wasn't obvious πŸŽ€). It's literally the class that implements JavaScript Date objects for JE. Let's get into it ✨


🌸 NAME 🌸

JE::Object::Date β€” the JavaScript Date object class. no cap, that's the whole name πŸ¦‹


✨ SYNOPSIS ✨

here's the vibe, copy-paste ready:

use JE;

$j = new JE;

$js_date = new JE::Object::Date $j;

$js_date->value; # 1174886940.466
"$js_date";      # Sun Mar 25 22:29:00 2007 -0700

see how value hands you a number and stringifying it hands you a whole date? that's the duality, that's the main character energy πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

This class implements JavaScript Date objects for JE. that's it, that's the job, and it ate πŸ”₯


🫢 METHODS 🫢

ngl, most of the methods are already documented elsewhere β€” peep JE::Types and JE::Object for descriptions of most of the methods. Only the stuff that's specific to JE::Object::Date gets explained right here, so pay attention bestie 😭

  • value β€” Returns the date as the number of seconds since the epoch, with up to three decimal places. yes, since the epoch, and yes, up to three decimal places β€” that fractional bit is not a typo, it's giving precision πŸ’–
  • class β€” Returns the string 'Date'. that's the whole thing. iconic behaviour, honestly 🌈

πŸ‘€ SEE ALSO πŸ‘€

go read these next, iykyk:

  • JE
  • JE::Types
  • JE::Object

and that's the page!! this lil doc came from perl v5.36.0 and it's dated 2023-08-25 β€” so if you're reading this way later, hi, hope your date math is still valid πŸ¦‹βœ¨ πŸ’œ

πŸ“¦ where this page comes from