Skip to content

Commit f5db108

Browse files
Ensure that fractional seconds are included when generating Unix times
1 parent 6acd020 commit f5db108

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pyspedas/tplot_tools/importers/netcdf_to_tplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def change_time_to_unix_time(time_var):
2626
dates = num2date(time_var[:], units=units)
2727
unix_times = list()
2828
for date in dates:
29-
unix_time = calendar.timegm(date.timetuple())
29+
unix_time = calendar.timegm(date.timetuple()) + date.microsecond/1e6
3030
unix_times.append(unix_time)
3131
return unix_times
3232

0 commit comments

Comments
 (0)