get first of current month
Moderators: Dorian (MJT support), JRL
get first of current month
I need some scripting help! I am looking to get the first of the current month, format (mm/dd/yy) and send the text to my program field. I then need to get the current date minus one day, format (mm/dd/yy) and send that text to my field. I am pretty new at this, and this has got me stuck. Any help would be great!!
Shannon
Here's examples for getting the dates
Code: Select all
//get date compnents
Day>dd
Month>mm
Year>yyyy
//make 2 digit year
Midstr>yyyy,3,2,yy
//First of month
Let>FirstOfCurrentMonth=%mm%/01/%yy%
//Today
Let>Today=%mm%/%dd%/%yy%
//There's probably a one line vbscript to do the following.
//This is what I know how to do.
//Today minus one but not the proper format
Sub>Today,1
//fix the date format
Separate>today,/,item
Length>item_1,len
If>len=1
Let>Item_1=0%item_1%
EndIf
Length>item_2,len
If>len=1
Let>Item_2=0%item_2%
EndIf
Length>item_3,len
If>len=4
Midstr>Item_3,3,2,Item_3
EndIf
//put the formated components back together
Let>TodayMinusOne=%Item_1%/%item_2%/%item_3%
MDL>FirstOfCurrentMonth = %FirstOfCurrentMonth%%CRLF%TodayMinusOne = %TodayMinusOne%