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`
Have `timedelta` increment the hours properly. Your date calculation is a little off tho.

```
from datetime import datetime, timedelta

old_date = '2000-01-01'

curr_date = datetime.strptime(old_date, '%Y-%m-%d') + timedelta(hours=138276 )

print(curr_date)

2015-10-10 12:00:00

```

To change output format, change `curr_date` to:

```
print(curr_date.strftime('%Y%m%d%H'))

2015101012

```