C
C
Cat_usual2019-07-16 02:36:50
Python
Cat_usual, 2019-07-16 02:36:50

Working with time?

Please tell me the best way to do this:

женаты (' + str(datetime.utcfromtimestamp(time.time() + 10800 - marry_time).strftime('%H:%M:%S')) + ' ' + str(datetime.utcfromtimestamp(time.time() + 10800 - marry_time).strftime('%d.%m')) + ')\n'

Marry_time is written time.time() + 10800 and after that I need to get the number of days the user is married by doing time.time() + 10800 - marry_time but it still returns 1 day of marriage, how do I get him displayed 0 days?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2019-07-16
@Cat_usual

Use time delta

marriage_date = datetime.date.now() + datetime.timedelta(hours=3)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question