plainblack.com
Username Password
search
Bookmark and Share
Subscribe

Date Macro

^D();
^D([date formatting code],[epoch date]);
The current date and time.

You can configure the date by using date formatting symbols. For instance, if you created a macro like this ^D("%c %D, %y"); it would output September 26, 2001. The following are the available date formatting symbols:

%% A literal percent sign '%'
%c The calendar month name.
%C The calendar month name abbreviated to 3 characters and represented in English.
%d A two digit day.
%D A variable digit day.
%h A two digit hour (on a 12 hour clock).
%H A variable digit hour (on a 12 hour clock).
%j A two digit hour (on a 24 hour clock).
%J A variable digit hour (on a 24 hour clock).
%m A two digit month.
%M A variable digit month.
%n A two digit minute.
%o Offset from local time represented as an integer.
%O Offset from GMT represented in four digit form with a sign. Example: -0600
%p A lower-case am/pm.
%P An upper-case AM/PM.
%s A two digit second.
%w Day of the week.
%W Day of the week abbreviated to 3 characters and represented in English.
%y A four digit year.
%Y A two digit year.
%z The current user's date format preference, (default: '%M/%D/%y').
%Z The current user's time format preference, (default: '%H:%n %p')

The default format code is %z %Z.

You can also pass in an epoch date into this macro as a secondary parameter. If no date is specified then today's date and time will be used.

One common task done with this macro is to display the date that an Asset was last modified. It uses the revisionDate template variable which is available for all Assets.

^D("%z",);

This Macro may be nested inside other Macros if the formatted date does not contain commas or quotes.

Common Example:

To setup a automatic copyright date:

©^D(%y);

Keywords: macro

Search | Most Popular | Recent Changes | Wiki Home
© 2023 Plain Black Corporation | All Rights Reserved