Advertisement
SharkyEXE

Untitled

Jan 13th, 2019
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. tdd = datetime.fromtimestamp(mktime(t))-datetime(date.today().year, 1, 1)
  2. sec_left=tdd.days*24*60*60+tdd.seconds
  3. x = 1123200
  4. if sec_left < x:
  5. title_text = _("Новый Год наступил !\nС праздником !")
  6. return title_text
  7. else:
  8. title_text = _("До Нового , %s Года , остал%s :\n") % ( date.today().year + 1, get_variant(days, ('ся', 'ось', 'ось')))
  9. text = [
  10. '{:0>1} д{}' . format(days, get_variant(days, ('ень', 'ня', 'ней'))),
  11. '{:0>2} час{}' . format(hours, get_variant(hours, ('', 'а', 'ов'))),
  12. '{:0>2} минут{}' . format(minutes, get_variant(minutes, ('а', 'ы', ''))),
  13. '{:0>2} секунд{}' . format(seconds, get_variant(seconds, ('а', 'ы', '')))
  14. ]
  15. return title_text + ' ; '.join(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement