← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba

 

Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.

Commit message:
Fix negative time-zone bug for cases like -00:30, i.e., hours is zero, but minutes are negative.

Requested reviews:
  Paul J. Lucas (paul-lucas)

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/153046

Fix negative time-zone bug for cases like -00:30, i.e., hours is zero, but minutes are negative.
-- 
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/153046
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/zorbatypes/datetime/timezone.cpp'
--- src/zorbatypes/datetime/timezone.cpp	2013-02-28 11:15:32 +0000
+++ src/zorbatypes/datetime/timezone.cpp	2013-03-13 03:17:21 +0000
@@ -108,6 +108,8 @@
   tz = TimeZone(hours);
   tz.data[MINUTE_DATA] = std::abs(minutes);
   tz.data[SECONDS_DATA] = std::abs(seconds);
+  if ( minutes < 0 || seconds < 0 )     // hours is checked in TimeZone() ctor
+    tz.is_negative = true;
   tz.normalize(); 
   return 0;
 }


Follow ups