Browse Source

Datetime fix

pull/28/head
Jure Šorn 5 years ago
parent
commit
d5e8f12745
1 changed files with 3 additions and 6 deletions
  1. 9
      README.md

9
README.md

@ -512,17 +512,14 @@ import pytz
### Format ### Format
```python ```python
>>> dt = datetime.strptime('2015-05-14 23:39:00', '%Y-%m-%d %H:%M:%S')
>>> dt.strftime("%dth %B '%y %A %I%p")
"14th May '15 Thursday 11PM"
>>> dt = datetime.strptime('2015-05-14 23:39:00.00 +0200', '%Y-%m-%d %H:%M:%S.%f %z')
>>> dt.strftime("%A %dth %B '%y, %I:%m%p %Z")
"Thursday 14th May '15, 11:05PM UTC+02:00"
``` ```
#### Rest of the codes: #### Rest of the codes:
* **`'b'` - Month, abbreviated name.** * **`'b'` - Month, abbreviated name.**
* **`'a'` - Weekday, abbreviated name.** * **`'a'` - Weekday, abbreviated name.**
* **`'f'` - Microseconds, 6 digits.**
* **`'z'` - Timezone offset, ± and 4 digits.**
* **`'Z'` - Timezone name.**
Arguments Arguments

Loading…
Cancel
Save