Page 1 of 1

${Time.Time12} displays 24hour time still

Posted: Tue Apr 13, 2004 12:45 am
by loadingpleasewait
The topic says it all.. Thanks

Posted: Tue Apr 13, 2004 1:09 am
by wilso132
Can't you just do a modulus 12 on it?

Code: Select all

integer%12

Posted: Tue Apr 13, 2004 1:12 am
by SwiftyMUSE
The code:

Code: Select all

	case Time12:
		{
			unsigned long Hour=pTime->tm_hour%12;
			if (!Hour)
				Hour=12;
			sprintf(DataTypeTemp,"%02d:%02d:%02d",pTime->tm_hour,pTime->tm_min, pTime->tm_sec);
			Dest.Ptr=&DataTypeTemp[0],
			Dest.Type=pStringType; 
		}
		return true;
should be:

Code: Select all

	case Time12:
		{
			unsigned long Hour=pTime->tm_hour%12;
			if (!Hour)
				Hour=12;
			sprintf(DataTypeTemp,"%02d:%02d:%02d",Hour,pTime->tm_min, pTime->tm_sec);
			Dest.Ptr=&DataTypeTemp[0],
			Dest.Type=pStringType; 
		}
		return true;

Posted: Tue Apr 13, 2004 1:16 am
by Lax
Indeed, sorry about that