Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,13 +1,12 @@
|
|||
import datetime
|
||||
|
||||
today = datetime.date.today()
|
||||
# The first requested format is a method of datetime objects:
|
||||
today.isoformat()
|
||||
# For full flexibility, use the strftime formatting codes from the link above:
|
||||
today.strftime("%A, %B %d, %Y")
|
||||
# This mechanism is integrated into the general string formatting system.
|
||||
# You can do this with positional arguments referenced by number
|
||||
"The date is {0:%A, %B %d, %Y}".format(d)
|
||||
# Or keyword arguments referenced by name
|
||||
"The date is {date:%A, %B %d, %Y}".format(date=d)
|
||||
# Since Python 3.6, f-strings allow the value to be inserted inline
|
||||
f"The date is {d:%A, %B %d, %Y}"
|
||||
|
||||
print(today.strftime("%Y-%m-%d"))
|
||||
# Or using the `isoformat` method of `date`.
|
||||
print(today.isoformat())
|
||||
|
||||
print(today.strftime("%A, %B %d, %Y"))
|
||||
# Or using a "format specifier" with `str.format` or an f-string.
|
||||
print("{today:%A, %B %d, %Y}".format(today=today))
|
||||
print(f"{today:%A, %B %d, %Y}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue