shape: (1, 2)
| Name | DOB |
|---|---|
| str | date |
| "Joram Mutenge" | 2020-07-13 |
dt.timestamp
Joram Mutenge
2025-11-17
Sometimes you may want the date value in your dataframe to display as a timestamp. This is useful when you need to hide the date of birth (DOB) of people in your dataset while presenting the data. Below is a dataframe showing the DOB of yours truly.
| Name | DOB |
|---|---|
| str | date |
| "Joram Mutenge" | 2020-07-13 |
To convert a date to a timestamp, use the date component timestamp as shown below:
| Name | DOB | DOB_ms |
|---|---|---|
| str | date | i64 |
| "Joram Mutenge" | 2020-07-13 | 1594598400000 |
Check out my Polars course for more insights.