The Date Time field allows input of a date or a date and a time, which display and interpretation you can specify as format, e.g., show dates with year/month/day or day-month-year.  

Date Time Overview

Icon

Date Time edit mode

Date Selection

Time Selection

Date time read-only display

Behavior


Attention: you must press the finish button to save your date and time selection; clicking out of the calendar and time input cancels your choice.

Limitation

The simple search in the content browser cannot find dates. In such a case, we recommend adding a channel filter.

Examples

  • Valid to or Valid from information for copyrights

  • Dates for Events

  • Employee Birthdays

  • Publication dates

  • Review dates

  • Embargo dates

Date Time Value Handling

Picturepark Setup Example

Layer: Corporate Information (ID: CorporateInformation)

Field: Embargo Date (ID: embargoDate)

Fieldpath

corporateInformation.embargoDate

Advanced search for field

Advanced search for the field value

  • Page:
    Search: Find Users by Creation Date Range (Solutions) — This will find all Users created in the last 60 days which are not Support Users. Adapt the date range to your specific case. 
    audit.creationDate:[now-60d TO now] AND isSupportUser:false
  • Page:
    Search: Find Items with Date (Solutions) — Will find all Content Items which have the date-time value "2022-02-1x". This query does not work with exact match.
    corporateInformation.embargoDate:2022-02-1*
  • Page:
    Search: Find Items with Date in Range (Solutions) — Will find all Content Items which were created or modified in March 2020
    audit.creationDate:[2020-03-01 TO 2020-03-31]
    audit.modificationDate:[2020-03-01 TO 2020-03-31]
  • Page:
    Search: Find Items with a Specific Date. (Solutions) — Will find all Content Items which have the exact date time value "2022-02-15T23:00:00Z". You can find this value in the JSON of the Content Item. This query only works with an exact match.
    corporateInformation.embargoDate:"2022-02-15T23:00:00Z"

Use in Display Pattern

  • Page:
    Display Pattern: Fieldset (Solutions) — For company events you have start and end dates. Calculate the duration from the two fields (Id: start; Id: end) in a fieldset (Id: duration) and show the values in days, or only the start date.
    {% if data.duration.end %} 
    
    {% assign end = data.duration.end | date: '%s' %} 
    {% assign start = data.duration.start | date: '%s' %} 
    {% assign durationSeconds = end | minus: start %}
    {% assign durationDays = durationSeconds | divided_by: 3600 | divided_by: 24 %}
    
    This event lasted {{ durationDays }} days.
    
    {% else %} This event started data.duration.start | local_date: "%d.%m.%Y %H:%M:%S".
    {% endif %} 
  • Page:
    Display Pattern: Date Time (Solutions) — Show a message “Publish Me” when a date (Id: embargoDate) on a Layer (Id: corporateInformation) is today or before today.
    {% assign today_date = 'now' | date: '%s' %} 
    {% assign embargo_date = data.corporateInformation.embargoDate | local_date %} 
    
    {% if today_date => embargo_date %} 
    Embargo lifted! Publish Me! 
    {% endif %} 

Returned field value

returns date as: 2019-12-19T01:02:02.000Z84

Date Time Field Settings

Name

The setting "name" is available for various things in Picturepark e.g. fields, schemas, business rules. This value defines what appears in the Picturepark interface. You can change the name at any time, and translate it into any configured metadata language. If you would like to add a translation for the name, just press Add.

  • ID's and Name need to be the same or at least the same meaning.

  • Sentence-style capitalization e.g. Media type and not Media Type.

  • Schema names in plural e.g. products, events, persons for lists.

  • No numbers at the beginning of the ID (mediaType2 is correct but not 2MediaType)

ID

The field id is the ID of your field, which is used to link to this field. The field id is always lowercase. The id of the field is set on the creation of a new field, using camel casing. You need the field id for the configuration of filters or display pattern. 

The ID is automatically created from the name you insert: 

  • Example: You insert the field name "My NeW fielDs #1 Purpose?

  • Automatic Id: myNeWFielDs1Purpose

You can open the Display Pattern Editor to see the JSON of a Content Item. 


Checkbox "Date and time."

Enabled: user can input date and time
Disabled: user can only input date

Once set and saved, this cannot be changed!

Set current date/time when creating Items

This will set the current date or date-time when Content Items or List Items which such a field are created. This will also add the current date or date-time to Content Items when a Layer with such a field is added. 

Format

The default format is DD-MMM-YYYY HH:mm:ss.
The format preview is: 27-Dec-2019 22:37:34

D stands for the day, M for the month, Y for the year. H stands for the hour, m for the minute, and s for the second. The number of those characters decides if, e.g., the day shows as 1, Mon, Monday. Sometimes two characters are possible, sometimes not. You can check the underlying JSON Schema definition, or you can play around with the preview directly displayed in the Content Platform: 

The format setting supports the JSON Schema Date Pattern, e.g., MM/DD/YYYY or DD-MM-YYYY hh:mm:ss. 

Sortable

The field setting "sortable" for a field defines if Picturepark uses the values of those fields for sorting of List Items (in Lists). Sorting of contents based on fields in a Layer is possible via the channel configuration, which only considers fields marked as sortable. All fields except for Geo Point and Relationship fields are sortable. This can be changed after field creation. 


Sort items based on the date entered to find the newest or oldest.

Include in filters

The field setting “Include in filters” allows the field to be added as a filter for content (see Channels Configuration) and the field values to be edited in the Batch Editor (indexed fields). Picturepark checks this setting against the allowed number of Search-indexed fields in your subscription plan. While it may be tempting to include all fields in filters and simple search also boosting them, you may revisit this idea based on your subscription plan limit, and by testing your common search scenarios - too much values will not automatically result in better search results.

Adding Dates or DateTime as a filter would show each single data entry. Therefore dates should be aggregated into periods (ranges), e.g., this week, this month, this year.

Include in search

The field setting "Include in Search" determines whether the field's values should be considered in content browser simple search operations. If this option is not enabled, the search does not consider the values of the field in search operations. This can be useful, for example, if the field is used for internal discussions or work directives that you don't want to affect the search results. Picturepark checks those settings against the allowed number of Search-indexed fields in your subscription plan. While it may be tempting to include all fields in filters and simple search also boosting them, you may revisit this idea based on your subscription plan limit.

The simple search in the content browser cannot find dates. In such a case, we recommend adding a channel filter.

Boost value

n/a