I need to get a split in hourly report .
Like today is 13th and its 5th hr,then my report should be like this:
13th 1st hr | 13th 2nd hr| 13th 3rd hr| 13th 4th hr |13th 5th hr|
I need to get like this split in the hours.
Not able to get any idea. Can someone help?
I finally cracked it i was not asking for split in the string i was asking for hours split.
i have done as below:
x = datetime.datetime.now()
print x
k= x.strftime("%H")
print k
k would be present hour
output :: 2019-05-16 17:59:52.806000
k=17
j = int(k)
for i in range(0,j):
if(i <=9):
num1='0'+str(i)
len = "start_date= {}:00:00&end_date= {}:59:59".format(num1,num1)
else:
num1=i
len = "start_date= {}:00:00&end_date= {}:59:59".format(num1,num1)
output:: start_date= 00:00:00&end_date= 00:59:59
start_date= 01:00:00&end_date= 01:59:59 . .till . start_date= 17:00:00&end_date= 17:59:59
This hour split i asked for not string split.