Commit 1c5605893e4ebb7b14e702b3352a34a954e2577b

  • Tree SHA1: 4b77d4d
  • Parent SHA1: 1565b71 (Merge commit 'refs/merge-requests/160' of git://gitorious.digitalstrom.org/dss/dss-mainline into integration)
  • raw diff | raw patch
global g_GMT_Offset => DateTime::kGMTOffset
core/datetools.cpp
(6 / 6)
  
2626
2727namespace dss {
2828
29 static long int g_GMT_Offset = 0;
29 long int DateTime::kGMTOffset = 0;
3030
3131 //================================================== DateTime
3232
310310 } // fromISO
311311
312312 DateTime DateTime::fromUTC(const time_t& _time) {
313 return DateTime(_time - g_GMT_Offset);
313 return DateTime(_time - kGMTOffset);
314314 } // fromUTC
315315
316316 DateTime DateTime::toUTC(const time_t& _time) {
317 return DateTime(_time + g_GMT_Offset);
317 return DateTime(_time + kGMTOffset);
318318 } // toUTC
319319
320320 DateTime DateTime::fromUTC() {
321 return DateTime(mktime(&m_DateTime) - g_GMT_Offset);
321 return DateTime(mktime(&m_DateTime) - kGMTOffset);
322322 }
323323
324324 DateTime DateTime::toUTC() {
325 return DateTime(mktime(&m_DateTime) + g_GMT_Offset);
325 return DateTime(mktime(&m_DateTime) + kGMTOffset);
326326 }
327327
328328 void DateTime::configureUTCOffset(long int _offset) {
329 g_GMT_Offset = _offset;
329 kGMTOffset = _offset;
330330 }
331331
332332 DateTime DateTime::NullDate(0);
core/datetools.h
(4 / 3)
  
5252 class DateTime {
5353 private:
5454 struct tm m_DateTime;
55 static long int kGMTOffset;
5556 public:
5657 /** Initializes the instance to be equal to \a DateTime::NullDate */
5758 DateTime();
173173 * time to UTC */
174174 static DateTime toUTC(const time_t& _time);
175175
176 /** Assumes current DateTime instance to be in UTC and creates an
176 /** Assumes current DateTime instance to be in UTC and creates an
177177 * instance a DateTime instance that is in local time */
178178 DateTime fromUTC();
179179
180 /** Assumes current DateTime instance to be in local time and creates an
180 /** Assumes current DateTime instance to be in local time and creates an
181181 * instance a DateTime instance that is in UTC */
182182 DateTime toUTC();
183183
184184 /** Configures the offset between UTC and local time which will be used
185 * for all subsequent calculations; the offset mst be in seconds West
185 * for all subsequent calculations; the offset mst be in seconds West
186186 * of GMT */
187187 static void configureUTCOffset(long int _offset);
188188 }; // DateTime