Skip to content
Advertisement

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.

JavaScript

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):

JavaScript

Advertisement

Answer

You could try something like this:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement