Skip to main content
Format parsed data as date and time

Convert and format fields into date, time, datetime

Updated over a month ago

Prerequisite

This guide assumes you are familiar with using field formats to normalize and format your data in Parseur. If not, check out this article for more information.

Overview

Dates and times can appear in various formats across documents. Often, applications integrated with Parseur require these fields to follow specific formatting rules. Parseur provides three types of date and time formats to help standardize your data.

1. Date format

The Date format extracts only the date from a field, ignoring any time information.

Examples of dates recognized by Parseur:

  • 12 Jan 2018

  • 2018-01-02

  • Wed Jan 24th, 2018 1:58pm → Extracts 24 Jan 2018

  • 01/12/2018 → Could mean January 12th or December 1st (disambiguation explained below).

Note:

  • Currently, Parseur only supports numeric dates and dates in English.

  • Support for other languages is on our roadmap. Upvote the feature request if this interests you to help prioritize it.

2. Time format

The Time format extracts only the time from a field, ignoring any date information.

Examples of times recognized by Parseur:

  • 1:58 pm

  • 13:58:23

  • 12h36

3. Date and time format

The Date and Time format extracts both the date and time from a field. If a time isn’t provided, Parseur defaults to 00:00:00.

Examples of datetimes recognized by Parseur:

  • Wed Jan 24th, 2018 1:58pm

  • 12 Jan 2018 13:58:23

  • 2018-01-24T05:18:44.841813+00:00

Configuring the Date Input Format

Some dates can be ambiguous. For example, 04/06/2024 could mean:

  • April 6th, 2024 (MM/DD/YYYY)

  • June 4th, 2024 (DD/MM/YYYY)

Parseur will try its best to determine the right date format for each incoming document. When it cannot reliably determine it, it will use the user settings (defaulting to Month-first).

When Parseur encounters ambiguous dates, it checks other dates in the document to try to detect the correct date format to use. If it cannot reliably determine the format, it uses your user settings, defaulting to month-first (MM/DD/YYYY). You can override these settings based on your preferences.

How to Configure the Date Input Format?

You can configure the input format at three levels:

  1. Account-level (applies to all mailboxes and templates by default)

  2. Mailbox-level (overrides account-level settings)

  3. Template-level (overrides both account- and mailbox-level settings)

Important: The “Day-first” setting won’t apply if the date starts with the year. For example, 2020-07-06 is always treated as July 6th, 2020, not June 7th.

Setting the Date Input Format at Account Level

  1. Under Input Formats, update the date format (choose either month-first or day-first).

  2. Optionally, update your timezone. This setting only affects date-related metadata and the Getswift integration if the field doesn’t already contain timezone information.

  3. Click Save.

Setting the Date Input Format at Mailbox Level

  1. Open the Mailbox.

  2. Click Settings.

  3. In the General tab, scroll to the bottom to find the input format settings.

  4. Update the input format as needed.

  5. Click Save.

Setting the Date Input Format at Template Level

  1. Open the Template.

  2. Click on the Settings tab.

  3. Update the input format.

  4. Click Update.

Configuring the Date Output Format

Once you’ve marked a field as a date, you can specify how it should appear in your parsed result output. The format of these fields will follow your output preferences.

How to Set the Date Output Format

  1. Scroll to the Output Formats section.

  2. Enter your preferred date output format (see below for available options)

  3. Click Save.

List of available output date formats

  • %a: Weekday as locale’s abbreviated name. Example: Mon

  • %A: Weekday as locale’s full name. Example: Monday

  • %w: Weekday as a decimal number, where 0 is Sunday and 6 is Saturday. Example: 1

  • %d: Day of the month as a zero-padded decimal number. Example: 30

  • %-d: Day of the month as a decimal number. (Platform specific). Example: 30

  • %b: Month as locale’s abbreviated name. Example: Sep

  • %B: Month as locale’s full name. Example: September

  • %m: Month as a zero-padded decimal number. Example: 09

  • %-m: Month as a decimal number. (Platform specific). Example: 9

  • %y: Year without century as a zero-padded decimal number. Example: 13

  • %Y: Year with century as a decimal number. Example: 2013

  • %H: Hour (24-hour clock) as a zero-padded decimal number. Example: 07

  • %-H: Hour (24-hour clock) as a decimal number. (Platform specific). Example: 7

  • %I: Hour (12-hour clock) as a zero-padded decimal number. Example: 07

  • %-I: Hour (12-hour clock) as a decimal number. (Platform specific). Example: 7

  • %p: Locale’s equivalent of either AM or PM. Example: AM

  • %M: Minute as a zero-padded decimal number. Example: 06

  • %-M: Minute as a decimal number. (Platform specific). Example: 6

  • %S: Second as a zero-padded decimal number. Example: 05

  • %-S: Second as a decimal number. (Platform specific). Example: 5

  • %f: Microsecond as a decimal number, zero-padded on the left. Example: 000000

  • %z: UTC offset in the form +HHMM or -HHMM (empty string if the object is naive).

  • %Z: Time zone name (empty string if the object is naive).

  • %j: Day of the year as a zero-padded decimal number. Example: 273

  • %-j: Day of the year as a decimal number. (Platform specific). Example: 273

  • %U: Week number of the year (Sunday as the first day of the week) as a zero padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0. Example: 39

  • %W: Week number of the year (Monday as the first day of the week) as a decimal number. All days in a new year preceding the first Monday are considered to be in week 0. Example: 39

  • %c: Locale’s appropriate date and time representation. Example: Mon Sep 30 07:06:05 2013

  • %x: Locale’s appropriate date representation. Example: 09/30/13

  • %X: Locale’s appropriate time representation. Example: 07:06:05

  • %%: A literal '%' character. Example: %

Did this answer your question?