Select to view content in your preferred language

How to format dates in data driven pages fields

4616
3
Jump to solution
12-01-2015 08:36 AM
DougBrowning
MVP Esteemed Contributor

Is there a way to format date fields in data driven page fields like you can do for dynamic text?  In dynamic text dates you can do things like format="short" but this does not work on data driven pages.  I have searched all over and found nothing.  Only option was to use an expression.

Thanks for any help.

I would like to do this

<dyn type="page" property="attribute" field="Date_" domainlookup="true"  format="short"/>

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Bummer.  For now I am doing a label expression and then using the expression tag in the data driven page field.  Like <dyn type="page" property="expression"/>

Expression was not easy to figure out

def FindLabel ([DATE_]):

    s = [DATE_]

    if s is None:

        return None

    return s.split(" ").pop(0)

View solution in original post

3 Replies
DavidBarnes
Deactivated User

You haven't missed anything. The dynamic text for data driven page fields just gets the information from the field as is. The various formatting tags are not supported in those cases. Might be a good idea to submit to the Ideas site.

DougBrowning
MVP Esteemed Contributor

Bummer.  For now I am doing a label expression and then using the expression tag in the data driven page field.  Like <dyn type="page" property="expression"/>

Expression was not easy to figure out

def FindLabel ([DATE_]):

    s = [DATE_]

    if s is None:

        return None

    return s.split(" ").pop(0)

JimmyKroon
Frequent Contributor

Thanks - I didn't need the time stamp at all, so I used your function to strip it out of the date field using the field calculator.

Strip time from date field.jpg

0 Kudos