-3

time.time() will give current Timestamp, I just want to get timestamp of 11PM or any time.

I need this to compare when time.time() == 11PM and then perform some task.

Learnings
  • 2,780
  • 9
  • 35
  • 55

1 Answers1

-1

Below script working:

import datetime, time

now = datetime.datetime.now()
time_to_change = now.replace(hour=23, minute=50, second=0, microsecond=0)
chepner
  • 497,756
  • 71
  • 530
  • 681
Learnings
  • 2,780
  • 9
  • 35
  • 55