JavaScript::QuickJS::Date - JavaScript `Date` in Perl
my $date = JavaScript::QuickJS->new()->eval("new Date()"); binmode \*STDOUT, ':encoding(utf-8)'; print $date->toISOString();
This class represents a JavaScript Date instance in Perl.
This class is not instantiated directly.
All correspond to their JavaScript equivalents:
Getters:
getFullYear(), getMonth(), getDate(), getHours(), getMinutes(), getSeconds(), getMilliseconds(), getDay()
getFullYear()
getMonth()
getDate()
getHours()
getMinutes()
getSeconds()
getMilliseconds()
getDay()
UTC variants of the above: getUTCFullYear(), getUTCMonth(), getUTCDate(), getUTCHours(), getUTCMinutes(), getUTCSeconds(), getUTCMilliseconds(), getUTCDay()
getUTCFullYear()
getUTCMonth()
getUTCDate()
getUTCHours()
getUTCMinutes()
getUTCSeconds()
getUTCMilliseconds()
getUTCDay()
Stringification: toString(), toUTCString(), toGMTString(), toISOString(), toDateString(), toTimeString(), toLocaleString(), toLocaleDateString(), toLocaleTimeString(), toJSON()
toString()
toUTCString()
toGMTString()
toISOString()
toDateString()
toTimeString()
toLocaleString()
toLocaleDateString()
toLocaleTimeString()
toJSON()
getTime(), getTimezoneOffset()
getTime()
getTimezoneOffset()
Setters:
setFullYear(), setMonth(), setDate(), setHours(), setMinutes(), setSeconds(), setMilliseconds()
setFullYear()
setMonth()
setDate()
setHours()
setMinutes()
setSeconds()
setMilliseconds()
UTC variants of the above: setUTCFullYear(), setUTCMonth(), setUTCDate(), setUTCHours(), setUTCMinutes(), setUTCSeconds(), setUTCMilliseconds()
setUTCFullYear()
setUTCMonth()
setUTCDate()
setUTCHours()
setUTCMinutes()
setUTCSeconds()
setUTCMilliseconds()
NB: getYear() and setYear() are omitted by design.
getYear()
setYear()
To install JavaScript::QuickJS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JavaScript::QuickJS
CPAN shell
perl -MCPAN -e shell install JavaScript::QuickJS
For more information on module installation, please visit the detailed CPAN module installation guide.