Python equivalent of java's Long.MAX_VALUE - System.currentTimeMillis()

1421
1
03-17-2014 05:59 PM
ByomjanB
New Contributor
How can i get  Python equivalent of Long.MAX_VALUE - System.currentTimeMillis()

Also i want yesterday's midnight 's values in Java's System.currentTimeMillis() from python or shell scripts ?Can any one help
Tags (2)
0 Kudos
1 Reply
JoshuaChisholm
Occasional Contributor III
Max int:
import sys
sys.maxint

As for max long, there is none for python (see here).

Current time:
import time
time.time()


Midnight time:
import time
import datetime
midnight = datetime.datetime.combine(datetime.date.today(), datetime.time.min)
midnightSec=time.mktime(midnight.timetuple()) #midnight this morning
lastMidnightSec-=86400 #midnight yesterday morning (there are 86400 seconds in a day)
0 Kudos