Skip to content

Commit b9d9163

Browse files
committed
Assume utc time for all dates. This is strictly correct (see below).
Matplotlib's docs state: 'objects are converted to floating point numbers which represent time in days since 0001-01-01 UTC, plus 1.' We convert to epoch time with mpl, so it's safe to assume we've got utc time! http://matplotlib.org/api/dates_api.html#module-matplotlib.dates
1 parent 568365e commit b9d9163

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plotly/matplotlylib/mpltools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def mpl_dates_to_datestrings(mpl_dates, format_string="%Y-%m-%d %H:%M:%S"):
460460
# make sure we have a list
461461
mpl_date_list = list(mpl_dates)
462462
epoch_times = matplotlib.dates.num2epoch(mpl_date_list)
463-
date_times = [datetime.datetime.fromtimestamp(epoch_time)
463+
date_times = [datetime.datetime.utcfromtimestamp(epoch_time)
464464
for epoch_time in epoch_times]
465465
time_strings = [date_time.strftime(format_string)
466466
for date_time in date_times]

0 commit comments

Comments
 (0)