While writing Postgres functions (stored procedures) in plperl I've learned that it's not possible to load perl modules such as "use Time::Piece;". Given that, what's the best way to handle date/time manipulations and comparisons in plperl? Using plperlu and loading modules is not an option for me.
I've had to resort to queries such as the following:
$query = "SELECT extract(day from timestamp '$eventDate') AS day,
extract(month from timestamp '$eventDate') AS month,
extract(year from timestamp '$eventDate') AS year";
I've also used SQL to convert timestamps to epoch time in order to do comparisons in perl. I'm hoping this is a silly question and there's a much more direct and simple way to deal with date/time functionality. Thanks.