Perl "days in the future"
-
I need to determine, for an events scheduling app, what days in the future are... As an example, someone may want to schedule an event for Sat, Jan. 30th, 2010, and every Saturday for the following 8 weeks... Got the rest of it working, just need a way to take an input field of "20100130", feed it into "perl date routine" and add to/loop thru to get my dates... I've looked around, seems like date::manip has what I want, but I'm not sure I'll be able to get that installed... does anyone know of a way to do this with "localtime"? I have searched extensively, can't find any instances of parms fed to localtime EXCEPT when it's adding time to today, etc... I need to first establish my date, by converting it from an input field, then adding to the result... sounds pretty simple, but I am not getting anywhere... and I'd be fine with a reference to read, if I've missed something... please forgive the clutter to this great board if I missed this somewhere.... thanks M. Holliday
-
I need to determine, for an events scheduling app, what days in the future are... As an example, someone may want to schedule an event for Sat, Jan. 30th, 2010, and every Saturday for the following 8 weeks... Got the rest of it working, just need a way to take an input field of "20100130", feed it into "perl date routine" and add to/loop thru to get my dates... I've looked around, seems like date::manip has what I want, but I'm not sure I'll be able to get that installed... does anyone know of a way to do this with "localtime"? I have searched extensively, can't find any instances of parms fed to localtime EXCEPT when it's adding time to today, etc... I need to first establish my date, by converting it from an input field, then adding to the result... sounds pretty simple, but I am not getting anywhere... and I'd be fine with a reference to read, if I've missed something... please forgive the clutter to this great board if I missed this somewhere.... thanks M. Holliday
Try
POSIX::mktime()
- you can use that to turn dates and times into atime_t
, then add N weeks worth of seconds and turn it back usinglocaltime()
.