Date Operations Guide: All 8 Date and Time Tools
A complete guide to extracting date parts, formatting dates, time deltas, date ranges, holidays, and date differences.
Date Operations Guide: All 8 Date and Time Tools
This guide explains every date operation: what it does, when to use it, and how to run it step by step.
---
1. Extract Date Parts
Plain English: Pulls out individual parts of a date—year, month, day, day of week, quarter, hour, minute, or second—into new columns.
When to use: You want to analyze by month, group by quarter, or filter by day of week (e.g., "weekday vs weekend").
Step-by-step:
- Select the date column.
- Choose Extract Date Parts.
- Select which parts to extract (year, month, day, day of week, quarter, hour, minute, second).
- Click Apply.
| Date | Year | Month | Day | DayOfWeek |
|---|---|---|---|---|
| 2024-02-16 | 2024 | 2 | 16 | 6 (Sat) |
| 2024-03-01 | 2024 | 3 | 1 | 6 (Fri) |
2. Format Date
Plain English: Changes how a date is displayed (e.g., "2024-02-16" to "Feb 16, 2024") without changing the underlying value. Used for reports and exports.
When to use: Your dates are in one format but you need them in another for display or export.
Step-by-step:
- Select the date column.
- Choose Format Date.
- Pick a format (e.g., YYYY-MM-DD, MM/DD/YYYY, Month DD YYYY).
- Or use a custom format string.
- Click Apply.
- Input: 2024-02-16
- Output: "Feb 16, 2024" or "02/16/2024"
3. Date Format (Parse)
Plain English: Converts text or numbers into proper date values. The opposite of Format—takes messy date strings and makes them usable dates.
When to use: Dates are stored as text ("15-Jan-2024") or numbers (44927) and need to be parsed into date type.
Step-by-step:
- Select the column.
- Choose Date Format or Parse Date.
- Specify the current format (e.g., DD-MM-YYYY, YYYY/MM/DD).
- Click Apply.
- Input: "16/02/2024" (text)
- Output: 2024-02-16 (date)
4. Time Delta
Plain English: Adds or subtracts a fixed amount of time (days, hours, minutes) from each date. Creates a new date column.
When to use: You need "7 days after order date", "1 month before start", or "end of business day" (e.g., add 9 hours).
Step-by-step:
- Select the date column.
- Choose Time Delta.
- Choose add or subtract.
- Enter the amount and unit (days, weeks, months, hours, minutes).
- Name the new column and click Apply.
| OrderDate | OrderDate + 7 days |
|---|---|
| 2024-02-16 | 2024-02-23 |
| 2024-02-20 | 2024-02-27 |
5. Delete Date Range
Plain English: Removes rows where the date falls inside a specified range (start date to end date).
When to use: Excluding a period (e.g., holiday week, bad data month) from analysis.
Step-by-step:
- Select the date column.
- Choose Delete Date Range.
- Enter start date and end date.
- Click Apply.
---
6. Flag Date Range
Plain English: Creates a new column (Yes/No or 1/0) indicating whether each date falls inside a specified range.
When to use: Marking a period for analysis (e.g., "During campaign?" or "In Q1?") without removing rows.
Step-by-step:
- Select the date column.
- Choose Flag Date Range.
- Enter start date and end date.
- Name the new column (e.g., "InCampaign").
- Click Apply.
| Date | InCampaign (Feb 1–15) |
|---|---|
| 2024-02-05 | Yes |
| 2024-02-20 | No |
| 2024-02-12 | Yes |
7. Date Difference
Plain English: Calculates the number of days (or other units) between two dates. Creates a new numeric column.
When to use: Age in days, days since signup, time between order and delivery.
Step-by-step:
- Choose Date Difference.
- Select the start date column.
- Select the end date column.
- Choose the unit (days, weeks, months, years).
- Name the new column and click Apply.
| StartDate | EndDate | DaysDiff |
|---|---|---|
| 2024-02-01 | 2024-02-16 | 15 |
| 2024-01-15 | 2024-02-16 | 32 |
8. Flag Holiday
Plain English: Creates a column indicating whether each date is a holiday (Yes/No). Can use built-in calendars (e.g., US, UK) or custom holiday lists.
When to use: Analyzing sales around holidays, excluding holidays from averages, or flagging holiday periods.
Step-by-step:
- Select the date column.
- Choose Flag Holiday.
- Select a calendar (US, UK, or custom).
- Optionally add custom holiday dates.
- Name the new column and click Apply.
| Date | IsHoliday |
|---|---|
| 2024-12-25 | Yes (Christmas) |
| 2024-02-16 | No |
| 2024-07-04 | Yes (US Independence Day) |
Quick Reference
| Operation | Purpose |
|---|---|
| Extract Date Parts | Get year, month, day, etc. |
| Format Date | Change display format |
| Date Format (Parse) | Text/numbers → dates |
| Time Delta | Add or subtract time |
| Delete Date Range | Remove rows in date range |
| Flag Date Range | Mark rows in date range |
| Date Difference | Days between two dates |
| Flag Holiday | Mark holiday dates |
Common Date Formats
| Format | Example |
|---|---|
| YYYY-MM-DD | 2024-02-16 |
| MM/DD/YYYY | 02/16/2024 |
| DD/MM/YYYY | 16/02/2024 |
| Month DD YYYY | Feb 16 2024 |
| DD-Mon-YYYY | 16-Feb-2024 |
What's Next?
- [Data Operations Guide](data-operations-guide) – Label encode, filter, transpose
- [String Operations Guide](string-operations-guide) – Text transforms
- [Math Operations Guide](math-operations-guide) – Arithmetic and scaling
Related Articles
Data Operations Guide: All 15 Transformations Explained
A complete guide to all 15 data operations: label encode, one-hot encode, filter, transpose, rename, date conversion, concatenate, cross tab, rename factor, impute, grouping, drop duplicates, ignore column, delete missing, and data table view.
String Operations Guide: All 20 Text Transformations
A complete guide to substring, replace, trim, pad, case changes, split, concatenate, length, contains, extract pattern, and 10 more string operations.
Math Operations Guide: All 12 Numeric Transformations
A complete guide to arithmetic, binning, log transform, power, round/ceil/floor, standardize, normalize, sign, Box-Cox/Yeo-Johnson, and cumulative operations.
Was this helpful?