Skip to content
Advertisement

Tag: datetime

find days between 2 dates in python but only number

I was trying to find difference of a series of dates and a date. for example, the series is from may1 to june1 which is the only thing i could get is this. I don’t want anything other than the number 1-10 cuz i need them for further numerical calculation but i can’t get rid of those. Also how could

Creating a range of dates and specific time in Python

I’m trying to define a range that begins at hour 2 rather than hour 0, but the following code returns all ranges beginning/ending at hour 0. The output for the code above is the following, but I want it to begin at specific hour (here 02:00:00 rather than 00:00:00): Answer You could try something like this: Output:

Advertisement