Question: I am looking at a netcdf file through Python and the date on the netcdf file is 138276, which is the number of hours since 2000-01-01 00:00:00. This date corresponds to October 7. How I can convert this date of 138276 hours since 2000-01-01 00:00:00 into the format of 2015-10-07 00:00:00?

Answer: 
Since the start date is constant, create a datetime object and just add whatever hours you want [using datetime.timedelta](https://docs.python.org/2/library/datetime.html#datetime.timedelta):

```
from datetime import datetime, timedelta

start = datetime(2000,1,1,0,0,0)

new = start + timedelta(hours=138276)

print(new)
2015-10-10 00:00:00

```

The answer is also `2105-10-10` not `2015-10-07`
You can use [`dt.strptime`](https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior) to parse your string into a datetime object and then construct a [`dt.timedelta`](https://docs.python.org/2/library/datetime.html#timedelta-objects) object and set param `hours=your_val` to add the required number of hours:

```
In [25]:
import datetime as dt
dt.datetime.strptime('2000-01-01 00:00:00', '%Y-%m-%d %H:%M:%S') + dt.timedelta(hours=138276)

Out[25]:
datetime.datetime(2015, 10, 10, 12, 0)

```

It's unclear to me how you arrive at a target date of `2015-010-07` when it's `2015-10-10`?