4

Is there a way to display previous and current year with dynamic text?

If so, what is the formatting?

I'm using ArcMap 10.0

1
  • 1
    Software + version? Commented Jun 19, 2013 at 21:43

2 Answers 2

3

Adding the current year is easy - the following goes into the text element:

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

However, I don't know a way to use just dynamic text to do last year. For that I would use ArcPy to update a "pseudo dynamic" text element which may or may not be applicable to what you are trying to do.

Not being able to do maths on dynamic text has been reported on this site in Doing Math calculations within ArcMap Dynamic Text? with the same conclusion.

As a workaround, the coding pattern is to use Python to set a variable to the calculated date, and then to have a recognizable string in your static text element called perhaps CalcDateVal, that ArcPy searches for and replaces with the contents of your variable.

2

Possible workaround:

  1. Instead of text box create small dataframe with say 1 point.
  2. Label point using Python parser:

    str( datetime.date.today() + datetime.timedelta(days=2))

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.