For our data visualization toolbox we need to be able to display graphs in any timezone the user selects. From how I understood the QCustomPlot code it is only possible to set the TimeSpec, thus allowing to show the time in UTC and the local timezone, but nothing else.

For our purposes I added the ability to set a timezone. Is it possible to adopt this code upstream, or are there better aproaches to solve the problem?

diff --git a/qcustomplot/qcustomplot.cpp b/qcustomplot/qcustomplot.cpp
index 45755b9b6..c80295bb7 100644
--- a/qcustomplot/qcustomplot.cpp
+++ b/qcustomplot/qcustomplot.cpp
@@ -5899,6 +5899,9 @@ double QCPAxisTicker::cleanMantissa(double input) const
 QCPAxisTickerDateTime::QCPAxisTickerDateTime() :
   mDateTimeFormat(QLatin1String("hh:mm:ss\ndd.MM.yy")),
   mDateTimeSpec(Qt::LocalTime),
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+  mDateTimeZone(),
+# endif
   mDateStrategy(dsNone)
 {
   setTickCount(4);
@@ -5926,6 +5929,7 @@ void QCPAxisTickerDateTime::setDateTimeFormat(const QString &format)
   to get the correct axis labels.
   
   \see setDateTimeFormat
+   \see setDateTimeZone
 */
 void QCPAxisTickerDateTime::setDateTimeSpec(Qt::TimeSpec spec)
 {
@@ -5933,6 +5937,21 @@ void QCPAxisTickerDateTime::setDateTimeSpec(Qt::TimeSpec spec)
 }
 
 /*!
+  Sets the time zone that is used for creating the tick labels from corresponding dates/times.
+
+  This value is not available for Qt < 5.2 .
+  This value is ignored if mDateTimeSpec != Qt::TimeZone.
+
+  \see setDateTimeSpec
+*/
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+void QCPAxisTickerDateTime::setDateTimeZone(const QTimeZone& zone)
+{
+	mDateTimeZone = zone;
+}
+# endif
+
+/*!
   Sets the tick origin (see \ref QCPAxisTicker::setTickOrigin) in seconds since Epoch (1. Jan 1970,
   00:00 UTC). For the date time ticker it might be more intuitive to use the overload which
   directly takes a QDateTime, see \ref setTickOrigin(const QDateTime &origin).
@@ -6044,6 +6063,10 @@ QString QCPAxisTickerDateTime::getTickLabel(double tick, const QLocale &locale,
 {
   Q_UNUSED(precision)
   Q_UNUSED(formatChar)
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+  if(mDateTimeSpec == Qt::TimeZone)
+    return locale.toString(keyToDateTime(tick).toTimeZone(mDateTimeZone), mDateTimeFormat);
+# endif
   return locale.toString(keyToDateTime(tick).toTimeSpec(mDateTimeSpec), mDateTimeFormat);
 }
 
diff --git a/qcustomplot/qcustomplot.h b/qcustomplot/qcustomplot.h
index 3b046e5d0..3c93f28fc 100644
--- a/qcustomplot/qcustomplot.h
+++ b/qcustomplot/qcustomplot.h
@@ -1608,10 +1608,16 @@ public:
   // getters:
   QString dateTimeFormat() const { return mDateTimeFormat; }
   Qt::TimeSpec dateTimeSpec() const { return mDateTimeSpec; }
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+  QTimeZone dateTimeZone() const { return mDateTimeZone; }
+# endif
   
   // setters:
   void setDateTimeFormat(const QString &format);
   void setDateTimeSpec(Qt::TimeSpec spec);
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+  void setDateTimeZone(const QTimeZone& zone);
+# endif
   void setTickOrigin(double origin); // hides base class method but calls baseclass implementation ("using" throws off IDEs and doxygen)
   void setTickOrigin(const QDateTime &origin);
   
@@ -1624,6 +1630,9 @@ protected:
   // property members:
   QString mDateTimeFormat;
   Qt::TimeSpec mDateTimeSpec;
+# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+  QTimeZone mDateTimeZone;
+# endif
   
   // non-property members:
   enum DateStrategy {dsNone, dsUniformTimeInDay, dsUniformDayInMonth} mDateStrategy;