3

I often use ArcMap 10 to display dynamic text using the dataFrame time.

<dyn type="dataFrame" name="Layout" property="time" emptyStr="[off]"/>

The above might display something like

2011/08/16

However what I really want to be able to do is add 1 day to the dataFrame time and display it. This way I can display a date range

2011/08/16 - 2011/08/17

Thanks

whuber
  • 69,783
  • 15
  • 186
  • 281
jrhicks
  • 241
  • 3
  • 6

2 Answers2

1

You'll need to add an additional field to your feature class and use the field calculator to populate the value.

Use the calculate field tool after adding the new (text) field.

In the expression: tomorrows_date(!date_field_that_has_a_date_in_it!)

In the code block:

import datetime
def tomorrows_date(date_string):
    date_format = "%Y/%m/%d"
    date_object = datetime.datetime.strptime(date_string, date_format)
    next_day = date_object + datetime.timedelta(days=1)
    return next_day.strftime(date_format)
Jason Scheirer
  • 18,002
  • 2
  • 53
  • 72
1

I was going to make this a comment on Jason's answer but I realised I can't include images.

Add a new field to the feature class you're using as an index (if you're using data driven pages) or to any other feature class in the data frame, then add a field to it of type DATE.

Then use field calculator to calculate the date as "8/7/2011" or something, including quotations. See my image below for the two steps.

enter image description here

You can have more than one text element like what you wrote in your question in a text field, so you can display both feature class fields.

Emily
  • 1,099
  • 1
  • 11
  • 23