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

Does anybody know of a Date class similiar to Java's Date that will hold a day, month, and a year, and can output to multiple formats? I'm looking for a standard before I write my own.
¥peace from CaMelRyder¥

Replies are listed 'Best First'.
Re: Data Encapsulation Class
by philcrow (Priest) on Feb 20, 2007 at 17:17 UTC
    If you search CPAN for date, you will find an overwhelming number to choose from some standbys include DateTime, Date::Calc, and Date::Manip.

    We use DateTime whenever possible.

    Phil

Re: Data Encapsulation Class
by Zaxo (Archbishop) on Feb 20, 2007 at 17:26 UTC

    If you want to keep it simple and can settle for dates expressible in epoch time, POSIX::strftime() with builtin localtime can provide great flexibility in output format. Some strftime formats reflect locale, so you don't need to do internationalization by hand.

    Time::Piece, Date::Calc::Object or DateTime are available if you must have a date class.

    After Compline,
    Zaxo

      Thanks for the recs guys. Can't seem to get DateTime to install, but Date::Manip looks sufficient.
      ¥peace from CaMelRyder¥

        Usually if you cannot get DateTime installed it is because it is missing some dependencies. What operating system are you using?

Re: Date Encapsulation Class
by davorg (Chancellor) on Feb 20, 2007 at 17:24 UTC