TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


engine:import:setvar2date

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
engine:import:setvar2date [2018/08/14 21:21] dcummingengine:import:setvar2date [2025/01/21 22:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
-setvar2date+====== SetVar2Date ======
  
-==== SetVar2Date ==== 
 Set a local variable to a date value. Set a local variable to a date value.
  
-==== Phase ====+===== Phase ====
 This instruction is used by the TapeTrack INI Engine. This instruction is used by the TapeTrack INI Engine.
  
-==== Syntax ==== +===== Syntax =====
-**SetVar2Date**//(varname, date, value);//+
  
-//string varname;//\\ +''SetVar2Date(varnamedatevalue);''
-//string date;//\\ +
-//string value;//\\+
  
-|varname| The name of the local variable that is to be set.+^ Variable ^ Type ^ Description ^ Min Length ^ Max Length ^ 
-|date| The string representing the date required in one of the following formats:|+|varname| String |Name of the local variable | 1 | 16 
 +|date| String | The daterequired in one of the formats in the table below| 1 | 64 | 
 +|value | String | The date value in strfdate(3) format | 1 | 64 |
  
 +^ Date Variable Formats^ Description^
 |*[+<nowiki>|</nowiki>-]n| Today's date plus or minus an optional number of days.| |*[+<nowiki>|</nowiki>-]n| Today's date plus or minus an optional number of days.|
 |*| Today.| |*| Today.|
Line 29: Line 29:
 |Y-1+3+3| The 3rd day of the third month of last year.| |Y-1+3+3| The 3rd day of the third month of last year.|
 |Y+10+3+3| The 3rd day of the 3rd month of the year 10 years from now.| |Y+10+3+3| The 3rd day of the 3rd month of the year 10 years from now.|
 +|<nowiki>M|m[+|-]m[+|-]d</nowiki>|The beginning or end of the month, + or - a number of months, + or - a number of days.|
 +|M-0| The start of the current month.|
 +|m-0| The end of the of the current month.|
 +|M-1| The start of last month.|
 +|M-1+3| The 3rd day of last month.|
  
  
 +===== Example =====
  
 +Set variable YESTERDAY to yesterday's date.
  
- +<code>
-M|m[+|-]m[+|-]d The beginning or end of the month, + or - a number of +
-months, + or - a number of days. +
-M-0 +
-m-0 +
-M-1 +
-M-1+3 +
-The start of the current month. +
-The end of the of the current month. +
-The start of last month. +
-The 3rd day of last month. +
-value The date value in strfdate(3) format. +
-Examples +
-Example A.17. SetVar2Date: Set variable YESTERDAY to yesterday's date.+
 SetVar2Date(YESTERDAY, "*-1", "%%Y-%%m-%%d"); SetVar2Date(YESTERDAY, "*-1", "%%Y-%%m-%%d");
 WriteMsg("Yesterday was %YESTERDAY"); WriteMsg("Yesterday was %YESTERDAY");
-Example A.18. SetVar2Date: Set variable START to the first day of this year and +</code> 
-END to the last.+ 
 + 
 +Set variable START to the first day of this year and END to the last. 
 + 
 +<code>
 SetVar2Date(START, "Y-0", "%%Y-%%m-%%d"); SetVar2Date(START, "Y-0", "%%Y-%%m-%%d");
 SetVar2Date(END, "y-0", "%%Y-%%m-%%d"); SetVar2Date(END, "y-0", "%%Y-%%m-%%d");
-66 
 WriteMsg("Date range is $START through $END"); WriteMsg("Date range is $START through $END");
 +</code>
 +
 +{{tag> import_engine sync_engine}}
engine/import/setvar2date.1534281660.txt.gz · Last modified: 2025/01/21 22:07 (external edit)