Contents 

WebLog Expert Help

Prev Page Next Page

Date Macros

You can use date macros in log file paths, report output paths, e-mail subject and message, etc. The date macros are based on the current date with correction for custom time offset (if such option is set).

Macro

Range

      Description


Date Modification

%Date%


This is the only macro that produces no output. It is used to change the base date for macros that are specified after it. By default the current date is used but you can add or subtract several days, weeks, months or years from the date by using the following macro formats:

 

%Date-N% or %Date+N% - add or subtract N days. You can also specify macros like %Date-Nd% or %Date+Nd% with the same effect.
%Date-Nw% or %Date+Nw% - add or subtract N weeks.
%Date-Nm% or %Date+Nm% - add or subtract N months.
%Date-Ny% or %Date+Ny% - add or subtract N years.

 

Examples: %Date-8%, %Date-1m%, %Date+3w%, %Date-2y%

 

Note: you can combine several date modifiers, e.g. %Date-2m-3w+3d%


Numeric Macros

These macros produce numeric output. You can either use simple format like %macro%, or format like %macro-N% or %macro+N%. N is a number added or subtracted from the macro value.

%dd%

01-31

Day of the month

%mm%

01-12

Month

%yy%

00-99

Year

%yyyy%

1900-...

Year

%dw%

1-7

Day of the week

%dy%

001-366

Day of the year

%wy%

01-54

Week of the year


Name Macros

%Month%

January-December

Month

%month%

january-december

Month

%MONTH%

JANUARY-DECEMBER

Month

%Mon%

Jan-Dec

Month

%mon%

jan-dec

Month

%MON%

JAN-DEC

Month

%DayOfWeek%

Sunday-Saturday

Day of the week

%dayofweek%

sunday-saturday

Day of the week

%DAYOFWEEK%

SUNDAY-SATURDAY

Day of the week

%Dow%

Sun-Sat

Day of the week

%dow%

sun-sat

Day of the week

%DOW%

SUN-SAT

Day of the week

 

Examples. The examples assume that the current date is August 18, 2008.

String with macros

Value

c:\Logs\%dd%%MON%%yyyy%.log

c:\Logs\18AUG2008.log

c:\Logs\%Date-1m%%mm%%dd%%yy%.log

c:\Logs\071808.log

/%wy-1%-%yyyy%.gz

/33-2008.gz