List Info

Thread: perl query




perl query
country flaguser name
United States
2008-03-17 00:57:51

In perl, how to find date after 5 days, if they have given todays date.

__._,_.___
.

__,_._,___
Re: perl query
country flaguser name
United States
2008-03-17 09:14:23

>>&gt;>> "srikanth" == srikanth kovur < srikanth_kovur%40yahoo.com">srikanth_kovuryahoo.com> 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&quot; for details.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<; merlyn%40stonehenge.com">merlynstonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

__._,_.___
.

__,_._,___
Re: perl query
country flaguser name
United States
2008-03-17 10:40:59

--- In perl-beginner%40yahoogroups.com">perl-beginneryahoogroups.com, "srikanth_kovur&quot;
<;srikanth_kovur...> wrote:
&gt;
> In perl, how to find date after 5 days, if they have given todays date.

Try the DateTime package. It can do many things including addition and
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/

Good luck

/sandy
http://myperlquiz.com/

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )