You can use a variety of date and time formats independently or in combination to control how dates and time display as dynamic text. These formats can be used for any date- or time-related dynamic text tag, such as date saved or current time. If used in combination, any spaces used to separate each format element appear in the output string on the page. The format syntax is case sensitive. Characters in the format string enclosed in single quotation marks appear in the same location and are unchanged in the output string.
To format date and time dynamic text, complete the following steps:
- To insert dynamic text on a layout, on the Insert tab, in the Graphics and Text group, click the Dynamic Text drop-down menu , and under Map Frame - Time, choose Current Time.
- In the layout view, drag a box to the desired location to create the dynamic text element.
The dynamic text element is added to the layout.
- Right-click the dynamic text element in the Contents pane and choose Properties to open the Element pane.
- In the Element pane, under Text, click the Text View button to show the complete dynamic text, and look at the syntax.
In the format attribute, the text to the left of the vertical bar controls the date format, and the text to the right controls the time format.
In the Element pane, the text appears as follows:
Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="short|short"/>.
On the page, the text appears as follows:
Current Time 7/31/2004 1:57 AM to 12/6/2007 3:15 PM
Note:
Dynamic text can be shown using Tag View or Text View . Tag View represents each dynamic text tag as a clickable button, with any static text displayed in the usual text format. Clicking the button opens a window allowing you to edit only that tag. Text View shows the full dynamic text tags together with any static text.
- Update the date and time formats using the options in the tables in the section below.
For example, in the Element pane, the text appears as follows:
Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="long|H:mm"/>.
On the page, the text appears as follows:
Current Time Saturday, July 31, 2004 1:57 to Thursday, December 06, 2007 15:15
- To display only the date, remove the vertical bar and include only a date format.
For example, in the Element pane, the text appears as follows:
Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="short"/>.
On the page, the text appears as follows:
Current Time 7/31/2004 to 12/6/2007
- To display only the time, remove the date format and include the vertical bar and a time format.
For example, in the Element pane, the text appears as follows:
Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="|h:mm:ss tt"/>.
On the page, the text appears as follows:
Current time 1:57:33 AM to 3:15:55 PM
Dynamic text tags
Date formats
Format | Description | Example syntax | Example output |
---|---|---|---|
empty | Month, day, and year as digits with no leading zero for single-digit days. | <dyn type="date" format=""/> | 9/7/2009 |
short | Month, day, and year as digits with no leading zero for single-digit days. | <dyn type="date" format="short"/> | 9/7/2009 |
long | Month and day as text with year. | <dyn type="date" format="long"/> | Monday, September 7, 2009 |
unishort | Unicode standard for short international date formats. | <dyn type="date" format="unishort"/> | Canada: 2009-09-07 Germany: 07.09.09 Japan: 2009/09/07 |
unimedium | Unicode standard for intermediate international date formats. | <dyn type="date" format="unimedium"/> |
Canada: Sep 7, 2009 Germany: 07.09.2009 Japan: 2009/09/07 |
unilong | Unicode standard for long international date formats. | <dyn type="date" format="unilong"/> | Canada: September 7, 2009 Germany: 7. September 2009 Japan: 2009年9月7日 |
unifull | Unicode standard for full international date formats. | <dyn type="date" format="unifull"/> | Canada: Monday, September 7, 2009 Germany: Montag, 7. September 2009 Japan: 2009年9月7 日月曜日 |
month | Month as text with year. | <dyn type="date" format="month"/> | September, 2009 |
d | Day of month as digits with no leading zero for single-digit days. | <dyn type="date" format="d"/> | 7 |
dd | Day of month as digits with leading zero for single-digit days. | <dyn type="date" format="dd"/> | 07 |
ddd | Day of week as a three-letter abbreviation. The function uses the LOCALE_SABBREVDAYNAME value associated with the specified locale. | <dyn type="date" format="ddd"/> | Mon |
dddd | Day of week as its full name. The function uses the LOCALE_SDAYNAME value associated with the specified locale. | <dyn type="date" format="dddd"/> | Monday |
M | Month as digits with no leading zero for single-digit months. | <dyn type="date" format="M"/> | 9 |
MM | Month as digits with leading zero for single-digit months. | <dyn type="date" format="MM"/> | 09 |
MMM | Month as a three-letter abbreviation. The function uses the LOCALE_SABBREVMONTHNAME value associated with the specified locale. | <dyn type="date" format="MMM"/> | Sep |
MMMM | Month as its full name. The function uses the LOCALE_SMONTHNAME value associated with the specified locale. | <dyn type="date" format="MMMM"/> | September |
y | Year as last two digits, but with no leading zero for years less than 10. | <dyn type="date" format="y"/> | 9 |
yy | Year as last two digits, but with leading zero for years less than 10. | <dyn type="date" format="yy"/> | 09 |
yyy or yyyy | Year represented by full four or five digits, depending on the calendar used. Thai Buddhist and Korean calendars both have five-digit years. The yyyy pattern will show five digits for these two calendars and four digits for all other supported calendars. | <dyn type="date" format="yyyy"/> | 2009 |
gg | Period/Era string. The function uses the CAL_SERASTRING value associated with the specified locale. This element is ignored if the date to be formatted does not have an associated era or period string. | <dyn type="date" format="gg"/> | A.D. |
Time formats
Format | Description | Example syntax | Example output |
---|---|---|---|
empty | Hour, minutes, and seconds with no leading zero for single-digit hours; 12-hour clock. | <dyn type="time" format=""/> | 4:08:09 PM |
short | Hour and minutes with no leading zero for single-digit hours; 12-hour clock. | <dyn type="time" format="short"/> | 4:08 PM |
long | Hour, minutes, and seconds with no leading zero for single-digit hours; 12-hour clock. | <dyn type="time" format="long"/> | 4:08:09 PM |
unishort | Unicode standard for short international time formats. | <dyn type="time" format="unishort"/> | Canada: 4:08 p.m. Germany: 16:08 Japan: 16:08 |
unimedium | Unicode standard for intermediate international time formats. | <dyn type="time" format="unimedium"/> | Canada: 4:08:09 p.m. Germany: 16:08:09 Japan: 16:08:09 |
unilong | Unicode standard for long international time formats. This includes the time zone. | <dyn type="time" format="unilong"/> | Canada: 4:08:09 p.m. PDT Germany: 16:08:09 GMT-7 Japan: 16:08:09 GMT-7 |
unifull | Unicode standard for full international time formats. This includes the time zone. | <dyn type="time" format="unifull"/> | Canada: 4:08:09 p.m. Pacific Daylight Saving Time Germany: 16:13:09 Nordamerikanische Westküsten-Sommerzeit Japan: 16時08分09秒 アメリカ太平洋夏時間 |
h | Hour with no leading zero for single-digit hours; 12-hour clock. | <dyn type="time" format="h"/> | 4 |
H | Hour with no leading zero for single-digit hours; 24-hour clock. | <dyn type="time" format="H"/> | 16 |
hh | Hours with leading zero for single-digit hours; 12-hour clock. | <dyn type="time" format="hh"/> | 04 |
HH | Hours with leading zero for single-digit hours; 24-hour clock. | <dyn type="time" format="HH"/> | 16 |
m | Minutes with no leading zero for single-digit minutes. | <dyn type="time" format="m"/> | 8 |
mm | Minutes with leading zero for single-digit minutes. | <dyn type="time" format="mm"/> | 08 |
s | Seconds with no leading zero for single-digit seconds. | <dyn type="time" format="s"/> | 9 |
ss | Seconds with leading zero for single-digit seconds. | <dyn type="time" format="ss"/> | 09 |
t | One-character time marker string, such as A or P. | <dyn type="time" format="t"/> | P |
tt | Multicharacter time marker string, such as AM or PM. | <dyn type="time" format="tt"/> | PM |