From: Warren Young Date: September 19 2008 12:23pm Subject: Re: Trouble with datatype 'TIME' List-Archive: http://lists.mysql.com/plusplus/7968 Message-Id: <17C9961E-B4D9-40B7-B1EA-CDB228E04010@etr-usa.com> MIME-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sep 19, 2008, at 2:01 AM, lists@stripped wrote: > cout << tt.hour() << ":" << tt.minute() << ":" << tt.second() << endl; > > hour(), minute() and second() are delivering unsigned char's Yes, so you want your output statement to be: > cout << int(tt.hour()) << ":" << int(tt.minute()) << ":" << > int(tt.second()) << endl; IOstream treats characters as ASCII characters, not as 8-bit integers.