The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

NAME

Data::Tersify::Plugin::DateTime - tersify DateTime objects

SYNOPSIS

 use Data::Tersify;
 print dumper(tersify({ now => DateTime->now }));
 # Prints just today's date and time in yyyy-mm-ss hh:mm:ss format,
 # rather than a full screen of DateTime internals

DESCRIPTION

This class provides terse description for DateTime objects.

handles

It handles DateTime objects only.

tersify

It summarises DateTime objects into human-readable representations, using variants of the One True Date format.

If the time is 00:00:00, it returns yyyy-mm-dd; if there's a more interesing time, it returns yyyy-mm-dd hh:mm:ss. If there's also a non-floating timezone, it returns details of that timezone as well, so yyyy-mm-dd hh:mm:ss Time/Zone.