Answer the question
In order to leave comments, you need to log in
datetime. How to write time correctly?
from datetime import datetime
def date_time(time):
dt=datetime.strptime(time, "%d.%m.%Y %H:%M")
#lstrip()-убираю пробел в начале. К делу не относится
# lstrip("0").replace(" 0"," ")-меняю 00 на 0
return dt.strftime("%e %B %Y year %H hours %M minutes").lstrip().lstrip("0").replace(" 0"," ")
Answer the question
In order to leave comments, you need to log in
Wrote a module .
Tried:
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import locale
import myplur
from datetime import datetime
locale.setlocale(locale.LC_ALL, 'ru_RU.utf8')
now = datetime.now()
hour = now.hour
minut = now.minute
print(hour, myplur.PlurHour(), minut, myplur.PlurMin())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question