How to get date in future?
Hi,
I write data to a crontab and want to see what the date the day before would be. Here is my crontab file. 35 21 1 7 6 perl blah.pl So this is... Min = 35, Hours = 9pm, Days = 1, Months = 7, Weekday = 6. So the current date for the crontab is July 1, 9:35PM, Saturday. I would like to get the date for the day before, hence June 30, 9:35PM, Friday. How best could I do this? |
Seeing as you mention Perl, use the Date::Calc.pm module.
Are you saying you want the called perl prog to calculate this, or something else. Its not clear? |
So basically I have an html form that takes user input on what time a meeting is scheduled. It will take the day, month, time of a meeting. I would like to send a meeting notice out with blah.pl exactly 1 day before the scheduled meeting. I would like perl to take the input from the html form and calculate what would be the exact month, day, weekday, time, one day prior to the original inputs.
|
Ok, yah the Date::Calc module was really great. Pretty easy to do what I wanted with this.
Used the Date_to_Days function and Add_Delta_Days function and it gave me what I wanted. Thanks! |
I wrote this bash script because I couldn't find anything on the net.
It turns the given date (if no parameters is given it will be today) to "Linux seconds" (seconds as of 1970 Jan 1 00:00) adds days * 86400 (a day has 86400 seconds) and then back again. I also made an "addhour" script the same way. Code:
# adday Code:
#!/bin/sh |
Code:
# addhour 1 20090228 Code:
#!/bin/sh |
All times are GMT -5. The time now is 10:16 PM. |