From: Adrian Cornish Date: July 30 2009 1:23pm Subject: Re: mysqlpp::Time and negative times List-Archive: http://lists.mysql.com/plusplus/8684 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable >> I've tried using mysqlpp::Time for negative times but I just get unsigne= d >> overflow on the hour field. > Are you talking about time time_t ctor or the h,m,s ctor? Actually I was using the string version. >>> From mysql docs: TIME >> >> values may range >> from >> '-838:59:59' to '838:59:59'. > > Wow, that's pretty random. =A0I wonder where they came up with those numb= ers? Very :-) > If you supply a patch to fix this, I'd just make it use signed characters > for now. =A0That's not *quite* an ABI breakage, whereas switching to a sh= ort > would be. =A0Obviously this is only helpful if you only need +/- 5ish day= s of > range. =A0If you need between 5 and 35 days, no such support will appear = in > MySQL++ before v4. What about adding another constructor with Time(short char h, unsigned char m, unsigned char s); The class could then keep track of which constructor was used and if the hour value could/should be negative. Or a bool flag (with getters & setters) could be added to class to indicate sign. Just some thoughts Adrian