http://www.perlmonks.org?node_id=1098484

jrefior has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am writing a Finance::StockAccount set of modules to analyze the past transactions in a personal stock account. I hope to distribute this on CPAN. Dates are incidental to this: I need to be able to import transactions with dates and compare dates to sort chronologically. I want to make it easy to use my modules, including when importing dates or setting a date using a string.

There are plenty of CPAN modules related to dates, including parsing, comparing, and formatting for display. So there is no reason for me to reinvent the wheel here. So far, I am thinking of using DateTime, the choice appears to be simple and defensible, as it seems so standard, is so robust, and there is so much built around it. DateTime::Format::CLDR and DateTime::Format::Flexible look like relatively standard and easy ways to import dates from strings. So then some of my classes will have a "date" property like date => $dt. Others will have methods that sort transactions by date using the DateTime->compare method.

That's all fine for me. But is that fine for the people who might use my module? Is there a standard or recommended way to handle dates in CPAN modules? Is a dependency on DateTime okay? DateTime has a lot of dependencies itself. I see Time::Moment is lighter weight, should I worry about performance? Any other thoughts/suggestions?

Thanks very much for your help.

John