Kenneth Jideofor \[ MTN - Ikoyi \] writes:
 > Hi,
 > 
 > Given a number of days, it is expected to determine the real date from Jan
 > 1, 1970.
 > The real date should be in the following format: Year-Month-Day.
 > 
 > How do I implement this task using Perl.
 > 
 > For example, write a Perl script to convert 12016 days to its real date from
 > Jan 1, 1970.

My first suggestion would be to install the Date::Calc module and read
the documentation.

Alternatively, a quick and dirty solution is:

perl -MPOSIX=strftime -e "print strftime('%Y-%m-%d', localtime(12016*60*60*24))"

This question sounds a bit like homework. Is it?

HTH

-- 
Brian Raven
Magically turning people's old scalar contexts into list contexts is a
recipe for several kinds of disaster.
             -- Larry Wall in <[EMAIL PROTECTED]>


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of 
LIFFE Holdings Plc or any of its subsidiary companies.
-----------------------------------------------------------------------

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to