use Time::Piece;
$d = localtime; # local time as a Time::Piece object
say $d->ymd; # yyyy-mm-dd format
say $d->datetime; # ISO 8601 format
$g = gmtime; # GMT as a Time::Piece object
use Time::Piece;
$d = localtime; # local time as a Time::Piece object
say $d->ymd; # yyyy-mm-dd format
say $d->datetime; # ISO 8601 format
$g = gmtime; # GMT as a Time::Piece object