View Single Post
Old 02-03-2015, 03:39 PM   #8
HuabaSchorsch
Junior Member
HuabaSchorsch began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2015
Device: none
Hi SZ readers!

The code above was not working anymore today since the ID calculation went wrong.
Actually the ID is just built by adding 86400 for each passing day. The corrected code is written below.

Bye!

-----
ID examples:
1422486000 29.Jan. (d29)
1423004400 04.Feb. (d35)


#P.S. 03.02.15
#BEG
d = 86400 #id delta between two days
d29 = 1422486000 #start id @ day 29
now = datetime.now()
dy = int(strftime('%j'))
dyt = dy + 1 # day of the year tomorrow
dg = dyt - 29
id_d = d * dg
id = d29 + id_d
#END
HuabaSchorsch is offline   Reply With Quote