Volkmaniac
Technical User
Hello,
I borrowed a date script taken off of This is a great script for date handling. I currently have the script grabbing everything from the previous month (02/01/04 to 02/29/04). I'd like the user to enter whichever month they'd like to run. Is there a way I can change cases or change the value of iMonth based on the month that the user enters? For instance, if they entered January I'd like 01/01/04 to 01/31/04.
ltimeints $LTIME iYear iMonth iDay2 iHour iMin iSec
if iDay2 <= 31
iMonth = iMonth-1
switch iMonth
case 1;January
case 3;March
case 5;May
case 7;July
case 8;August
case 10;October
case 12;December
iDay2 = 31;31 Days
endcase
case 4;April
case 6;June
case 9;September
case 11;November
iDay2 = 30;30 days
endcase
case 2
intsltime iYear iMonth iDay2 iHour iMin iSec TimeVal;Convert to a long time value
ltimemisc TimeVal iWeekday iDayYear iLeapYear;Get leap year value
if iLeapYear == 1;If leap year
iDay2 = 29;Set day to 29
else
iDay2 = 28;Else 28
endif
endcase
endswitch
endif
strfmt sDate2 "%02d-%02d-%d" iMonth iDay2 iYear;
strdelete sDate2 6 2;take off the first two digits of the year
I borrowed a date script taken off of This is a great script for date handling. I currently have the script grabbing everything from the previous month (02/01/04 to 02/29/04). I'd like the user to enter whichever month they'd like to run. Is there a way I can change cases or change the value of iMonth based on the month that the user enters? For instance, if they entered January I'd like 01/01/04 to 01/31/04.
ltimeints $LTIME iYear iMonth iDay2 iHour iMin iSec
if iDay2 <= 31
iMonth = iMonth-1
switch iMonth
case 1;January
case 3;March
case 5;May
case 7;July
case 8;August
case 10;October
case 12;December
iDay2 = 31;31 Days
endcase
case 4;April
case 6;June
case 9;September
case 11;November
iDay2 = 30;30 days
endcase
case 2
intsltime iYear iMonth iDay2 iHour iMin iSec TimeVal;Convert to a long time value
ltimemisc TimeVal iWeekday iDayYear iLeapYear;Get leap year value
if iLeapYear == 1;If leap year
iDay2 = 29;Set day to 29
else
iDay2 = 28;Else 28
endif
endcase
endswitch
endif
strfmt sDate2 "%02d-%02d-%d" iMonth iDay2 iYear;
strdelete sDate2 6 2;take off the first two digits of the year