2

In ArcMap I would like to setup an MXD to have a dynamic element that displays a date range. It is easy enough to add dynamic text that displays the current date using the following:

<dyn type="date" format="short"/>

However, I really need to have a dynamic element that displays the a date range for the last 8 months.

In other words, if today is 10/23/2017 is it possible to create a dynamic text tag that would display "2/23/2017 through 10/23/2017"?

  • Would you be open to a custom tool (say, a button) which when pressed, updates a text field with the date range? – Fezter Oct 23 '17 at 22:06
4

You could try this approach, Working with dynamic text, a time slider window is needed.

>Data Frame Time Data Frame Time: <dyn type="dataFrame" name="Main Map" property="time"/>

This is the point in time at which the time-enabled data is displayed in the specified data frame. This is not the current date or time as expressed using the Current Date or Current Time dynamic text element. Using the Time Slider window, you can display time-enabled data at a specific time or within a specified time window. The Data Frame Time dynamic text will update automatically to show the time currently displayed.

Yes it is possiblee, in Esri's Dates, Time, and dynamic text, they provide a variety of code examples:

There are a variety of date and time formats available that can be used 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 will 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 unchanged in the output string.

To insert dynamic text on a layout, on the Insert tab, in the Text group, click the Dynamic Text Add Dynamic Textdrop-down menu and under Map Frame -

Time choose Current Time.

In the Format Text pane, under Text, 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 Format Text pane the text will look like this:

Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="short|short"/>.

On the page the text will display like this:

Current Time 7/31/2004 1:57 AM to 12/6/2007 3:15 PM

Update the date and time formats using the options available in the tables below. For example:

Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="long|H:mm"/>.

Will display as:

Current Time Saturday, July 31, 2004 1:57 to Thursday, December 06, 2007 15:15

To just display the date, remove the vertical bar and just include a date format.
For example:
Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="short"/>.
Will display as:
Current Time 7/31/2004 to 12/6/2007

To just display the time, remove the date format and just include the vertical bar and a time format. For example:

Current Time <dyn type="mapFrame" name="Map Frame Name" property="time" format="|h:mm:ss tt"/>.

Will display as:

Current time 1:57:33 AM to 3:15:55 PM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.