>>>>> "srikanth" == srikanth kovur <srikanth_kovur@...> writes:srikanth> In perl, how to find date after 5 days, if they have given todays date.
my $in_5_days = localtime (time + 5 * 86400);
If you want it as values instead of a string, use list context
instead of scalar context. "perldoc -f localtime" for details.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
- --- In firstname.lastname@example.org, "srikanth_kovur"
>Try the DateTime package. It can do many things including addition and
> In perl, how to find date after 5 days, if they have given todays date.
subtraction of periods of time, which works correctly with respect to
a given time zone with all crazy things like DST transitions, leap
seconds and such: http://datetime.perl.org/