Parse date parser
Configuration options
- Timezone - The time zone of the result. Source values without a time zone are read in this time zone. Values with a time zone are converted to it.
- Locale of source date - The language of the source value, used to read month names and words such as "yesterday" in that language.
- Format - The format of the result.
Results for the source value 2024-03-05 14:30 with Timezone set to UTC:
| Format | Result |
|---|---|
Y-m-d |
2024-03-05 |
Y-m-d H:i:s |
2024-03-05 14:30:00 |
Y-m-d h:i A |
2024-03-05 02:30 PM |
ISO 8601 |
2024-03-05T14:30:00+00:00 |
UNIX timestamp |
1709649000 |
Convert dates to one format
Parse date reads common date and time notations and returns them in the selected format.
Source:
March 5, 2024
Format:
Y-m-d
Result:
2024-03-05
Other source values that return the same result with Format set to
Y-m-d:
2024-03-05 14:30
5 March 2024
Mar 5 2024 2:30 PM
Tue, 05 Mar 2024 14:30:00 GMT
05.03.2024
A value with a month and year only, such as March 2024, returns the first day
of that month.
Dates with slashes are read as month/day/year
A value such as 05/03/2024 is read as 3 May 2024, not 5 March 2024. When the
website uses day/month/year with slashes, replace the slashes with periods
before Parse date.
Example source:
05/03/2024
Configuration of the Replace text parser:
Text to replace: /
Text to place: .
Use Regex: No
Result after Parse date with Format set to Y-m-d:
2024-03-05
Relative dates
Values such as today, yesterday, 3 days ago, 2 weeks ago and
last Monday are converted to a date relative to the time when the record was
scraped.
Dates without a year
When the source value has no year, the year when the data was scraped is used.
For example, 5 March scraped in 2026 becomes 2026-03-05.
Impossible dates roll over to the next valid date. For example, 2024-02-30
becomes 2024-03-01.
Time zones
Source values without a time zone are read in the selected Timezone:
Source: 2024-03-05 14:30
Timezone: Europe/Riga
Result: 2024-03-05T14:30:00+02:00
Source values with a time zone are converted to the selected Timezone:
Source: 2024-03-05T14:30:00Z
Timezone: Europe/Riga
Result: 2024-03-05T16:30:00+02:00
Source: 2024-03-05T14:30:00+05:00
Timezone: UTC
Result: 2024-03-05T09:30:00+00:00
The results above use the ISO 8601 format. Select the time zone of the website
when its dates do not include a time zone. Use UTC when data from several
regions is compared.
Dates in other languages
Set Locale of source date to the language of the website.
Source: 5 mars 2024
Locale of source date: fr
Format: Y-m-d
Result: 2024-03-05
With the English locale, the same source value is read with the wrong year. Some phrasings are not recognized, such as Spanish dates with words between the day, month and year, or relative dates such as "3 days ago" written in German. Check the preview with the values the website uses.
Values that cannot be read
A value that cannot be read is returned unchanged. This includes UNIX
timestamps, such as 1709648400. Use the
Convert UNIX timestamp parser for those.
Dates surrounded by other text
Parse date needs the date itself. Extract it with Regex match first.
Example source:
Posted on 5 March 2024
Configuration of the Regex match parser:
Regex: \d{1,2} \w+ \d{4}
Group: Match 0
Result after Parse date with Format set to Y-m-d:
2024-03-05
Empty values
An empty source value becomes the current date and time, the moment the preview or export runs. Review the Parser preview when the source column can be empty, and check the records that have no date on the website.
Parser order
Raw value
→ Regex match
→ Replace text
→ Parse date
When to use Convert UNIX timestamp instead
Use Convert UNIX timestamp when the source value is a UNIX timestamp. Parse date returns UNIX timestamps unchanged.
Troubleshooting
- If the day and month are swapped, the source uses day/month/year with slashes. Replace the slashes with periods first.
- If values are returned unchanged, check for surrounding text and check Locale of source date.
- If times are off by a few hours, check Timezone and whether the source value includes its own time zone.
- If records without a date show the current date and time, the source value was empty.