How can I change the format of a date field?
When you parse a date field from an email, chances are high that you want to change the format of the date to something more standard. This can be accomplished with our "Format Dates" filter which you can find inside the sub-section "Refine Results".
In most cases, the filter will recognize the input format and automatically give you a standardized output. You can see this behavior in the following image:
In case the automatic date recognition doesn't work, it is also possible to define a custom pattern for the input and output. Date patterns are described with the same syntax used by the PHP date function. Please refer to the table below for the most common formatting options.
For example, if you would want to turn "Tuesday, 29th August 2015" into "2015-08-29", you would use the following patterns: "N, jS F Y" as the input and "Y-m-d" as the output pattern.
Day Formatting Syntax
|d||Day of the month, 2 digits with leading zeros||01 to 31|
|D||A textual representation of a day, three letters||Mon through Sun|
|j||Day of the month without leading zeros||1 to 31|
|l(lowercase 'L')||A full textual representation of the day of the week||Sunday throughSaturday|
|S||English ordinal suffix for the day of the month, 2 characters||st, nd, rd or th. Works well with j|
Week Formatting Syntax
|W||ISO-8601 week number of year, weeks starting on Monday||Example: 42 (the 42nd week in the year)|
Month Formatting Syntax
|F||A full textual representation of a month, such as January or March||January through December|
|m||Numeric representation of a month, with leading zeros||01 through 12|
|M||A short textual representation of a month, three letters||Jan through Dec|
|n||Numeric representation of a month, without leading zeros||1 through 12|
Year Formatting Syntax
|Y||A full numeric representation of a year, 4 digits||Examples: 1999 or 2003|
|y||A two-digit representation of a year||Examples: 99 or 03|
Time Formatting Syntax
|a||Lowercase Ante meridiem and Post meridiem||am or pm|
|A||Uppercase Ante meridiem and Post meridiem||AM or PM|
|B||Swatch Internet time||000 through 999|
|g||12-hour format of an hour without leading zeros||1 through 12|
|G||24-hour format of an hour without leading zeros||0 through 23|
|h||12-hour format of an hour with leading zeros||01 through 12|
|H||24-hour format of an hour with leading zeros||00 through 23|
|i||Minutes with leading zeros||00 to 59|
|s||Seconds, with leading zeros||00 through 59|
Other Formatting Options
|timestamp||Returns the Linux timestamp (seconds since 1st Jan 1970)|| 1449237286
Please note that the date filter can be applied to dates that are parsed from the content of the email. The filter is not available for the "received at" and "processed at" dates. Those two dates are generated by mailparser.io and always come in a standard format and in the timezone you chose for your account.