PYPROGLIB Telegram 5872
💩 Как использовать f-строки для форматирования datetime

Возможно вы знаете про такой метод преобразования объекта datetime в строку:
from datetime import datetime
landing = datetime(1969, 7, 20, 20, 17, 40)

landing.strftime("%a, %d %b %Y %H:%M:%S")
# -> Sun, 20 Jul 1969 20:17:40


⭐️ Но есть и альтернативный метод — с помощью f-строк
print(f"{landing:%a, %d %b %Y %H:%M:%S}")


#совет
Please open Telegram to view this post
VIEW IN TELEGRAM
👍41🤩4



tgoop.com/pyproglib/5872
Create:
Last Update:

💩 Как использовать f-строки для форматирования datetime

Возможно вы знаете про такой метод преобразования объекта datetime в строку:

from datetime import datetime
landing = datetime(1969, 7, 20, 20, 17, 40)

landing.strftime("%a, %d %b %Y %H:%M:%S")
# -> Sun, 20 Jul 1969 20:17:40


⭐️ Но есть и альтернативный метод — с помощью f-строк
print(f"{landing:%a, %d %b %Y %H:%M:%S}")


#совет

BY Библиотека питониста | Python, Django, Flask


Share with your friend now:
tgoop.com/pyproglib/5872

View MORE
Open in Telegram


Telegram News

Date: |

“Hey degen, are you stressed? Just let it all out,” he wrote, along with a link to join the group. Avoid compound hashtags that consist of several words. If you have a hashtag like #marketingnewsinusa, split it into smaller hashtags: “#marketing, #news, #usa. "Doxxing content is forbidden on Telegram and our moderators routinely remove such content from around the world," said a spokesman for the messaging app, Remi Vaughn. On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information. Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data.
from us


Telegram Библиотека питониста | Python, Django, Flask
FROM American