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`
If you are using the netCDF4 package, you should use the [`num2date`](http://unidata.github.io/netcdf4-python/#section7) function.

```
In [1]: from netCDF4 import num2date

In [2]: date = num2date(138276, 'hours since 2000-01-01 00:00:00', calendar='standard')

In [3]: date
Out[3]: datetime.datetime(2015, 10, 10, 12, 0)

```

most likely, your netCDF time variable also has the units and calendar in there so you probably don't need to hard code those. In fact, the num2date function will take a list or array of dates.