in reply to How to get the current Date and Time using Perl on windows?
Resorting to invoking system commands is hardly ever the way to get stuff done. Perl has a number of built in commands to retrieve the current time. time gets the current 'epoch' from the system. gmtime or localtime may be used to convert the epoch returned by time to a list of date and time elements.
However, date and time is a big industry in the Perl world and there are many modules on CPAN that deal with date and time manipulation. The kitchen sink module is Date::Manip. Watch out under Windows though because you will almost certainly need to initialize the time zone before using any of the module's features (see the 'KNOWN PROBLEMS' section).
|
|---|