Basics
Details can be found in the official documentation
datetime.strftime(format)- date to string conversion [string format time]
strptime(string, format)- string to date conversion [string parse time]
| Directive | Description | Example |
|---|---|---|
| %c | Date and time (l) | Tue Aug 16 21:30:00 1988 |
| %x | Date (l) | 08/16/1988 |
| %X | Time (l) | 21:30:00 |
| %% | Literal '%' | % |
(l): Locale dependent