DateAdd
DateAdd>date,interval,amount,result
Adds (or subtracts) a number of days, weeks, months or years to (or from) a date.
Interval can take one of the following values:
- D: Days
- W: Weeks
- M: Months
- Y: Years
Amount can be a positive or negative amount to apply to the date.
The date must be in local system format. Use DateLocal to generate a date in local system format.
DateAdd Example
GetDate>today
DateAdd>today,D,-1,yesterday
DateAdd>today,M,1,NextMonth
DateAdd>today,W,-1,LastWeek
DateAdd>today,Y,-2,TwoYearsAgo
DateDiff
DateDiff>date1,date2,interval,result
Returns the difference between two dates. Interval can be one of:
Interval can take one of the following values:
- D: Days
- W: Weeks
- M: Months
- Y: Years
The date must be in local system format. Use DateLocal to generate a date in local system format.
DateDiff Example
GetDate>today
DateAdd>today,M,1,NextMonth
DateDiff>today,NextMonth,D,numberDays
DateLocal>Year,Month,Day,result
Given year, month and day portions DateLocal returns a date in local system format.
DateLocal Example
DateLocal>2014,03,21,theDate
DatePart
DatePart>date,interval,result
Returns part of a date specified by interval. Interval can be one of:
- D: Day of month
- M: Month
- Y: Year
The date must be in local system format. Use DateLocal to generate a date in local system format.
DatePart Example
GetDate>today
DatePart>today,M,thisMonth
DateStamp
DateStamp>filename,comment
Outputs the date and time in milliseconds and the given comment to the given text file.
Abbreviation : DAT
See also: TimeStamp
DateStamp Example
DateStamp>c:\temp\mylogfile.txt,Macro Started
The file entry would appear :
1999-08-06:13:38:10:352 - Macro Started
Day
Day>result
Returns the current day number of the month in the specified variable.
Day Example
Day>the_day
Month>the_month
Year>the_year
Message>The date is : %the_day% - %the_month% - %the_year%
DayOfWeek
DayOfWeek>result
Returns the current week day number, starting with Sunday as day 1, and ending on Saturday with day 7.
Abbreviation : DOW
DayOfWeek Example
This example displays the current day as a proper day name. It also shows how to use variables in a Goto command.
DayOfWeek>result
Goto>Day%result%
Label>Day1
Let>DayString=Sunday
Goto>Continue
Label>Day2
Let>DayString=Monday
Goto>Continue
Label>Day3
Let>DayString=Tuesday
Goto>Continue
Label>Day4
Let>DayString=Wednesday
Goto>Continue
Label>Day5
Let>DayString=Thursday
Goto>Continue
Label>Day6
Let>DayString=Friday
Goto>Continue
Label>Day7
Let>DayString=Saturday
Goto>Continue
Label>Continue
MessageModal>DayString
GetDate
GetDate>result
Returns the current date in the specified variable. The format of the date depends on the regional settings of the system.
Abbreviation : GDT
GetDate Example
GetDate>date
Let>msg=The Date Is :
ConCat>msg,date
Message>msg
GetTime
GetTime>result
Returns the current time in the specified variable. The format of the time depends on the regional settings of the system.
Abbreviation : GTM
GetTime Example
GetTime>time
Let>msg=The Time Is :
ConCat>msg,time
Message>msg
Hour
Hour>result
Returns the hour portion of the current time in the specified variable.
Hour Example
Sec>Seconds
Min>Minutes
Hour>Hour
Message>The time is : %Hour% : %Minutes% : %Seconds%
Min
Min>result
Returns the minutes portion of the current time in the specified variable.
Min Example
Sec>Seconds
Min>Minutes
Hour>Hour
Message>The time is : %Hour% : %Minutes% : %Seconds%
Month
Month>result
Returns the current month number in the specified variable
Abbreviation : Mon
Month Example
Day>the_day
Month>the_month
Year>the_year
Message>The date is : %the_day% - %the_month% - %the_year%
Sec
Sec>result
Returns the seconds portion of the current time in the specified variable.
Sec Example
Sec>Seconds
Min>Minutes
Hour>Hour
Message>The time is : %Hour% : %Minutes% : %Seconds%
TimeAdd
TimeAdd>time,interval,amount,result
Adds (or subtracts) a number of hours, minutes or seconds to (or from) a time.
Interval can take one of the following values:
- H: Hours
- M: Minutes
- S: Seconds
Amount can be a positive or negative amount to apply to the time.
The time must be in local system format. Use DateLocal to generate a time in local system format.
TimeAdd Example
GetTime>now TimeAdd>now,H,-1,OneHourEarlier
TimeAdd>now,M,30,HalfHourLater
TimeDiff
TimeDiff>time1,time2,interval,result
Returns the difference between two times. Interval can be one of:
- H: Hours
- M: Minutes
- S: Seconds
The time must be in local system format. Use DateLocal to generate a time in local system format.
TimeDiff Example
GetTime>now
TimeAdd>now,H,12,LaterTime
TimeDiff>now,LaterTime,M,numberMins
TimePart
TimePart>time,interval,result
Returns part of a time specified by interval. Interval can be one of:
- H: Hours
- M: Minutes
- S: Seconds
The time must be in local system format. Use DateLocal to generate a time in local system format.
TimePart Example
GetTime>now
TimePart>now,H,CurrentHour
TimeLocal
TimeLocal>Hour,Minute,Second,Result
Given hour (24 hour notation), minute and second portions TimeLocal returns a time in local system format.
TimeLocal Example
TimeLocal>13,15,00,localTime
Timer
Timer>result
Returns the number of milliseconds that have elapsed since the script was started.
Timer Example
Timer>startTime
..
.. do something here
..
Timer>endTime
Let>elapsed_seconds={(%endTime%-%startTime%)/1000}
MessageModal>Seconds elapsed: %elapsed_seconds%
TimeStamp
TimeStamp>filename,comment
Outputs the time in milliseconds and the given comment to the given text file.
Abbreviation : TIM
See also: DateStamp
TimeStamp Example
TimeStamp>c:\temp\mylogfile.txt,Macro Finished
The file entry would appear :
15:43:03:066 - Macro Finished
Year
Year>result
Returns the current year in the specified variable
Abbreviation : Mon
Year Example
Day>the_day
Month>the_month
Year>the_year
Message>The date is : %the_day% - %the_month% - %the_year%
Comments
0 comments
Please sign in to leave a comment.