sqldata/str.cpp
// Convert 7-byte packed Oracle DATE to string (non-null terminated, exactly 19 characters)
Convert 7-byte packed Oracle DATE to string (non-null terminated, exactly 19 characters)
Convert 7 - byte packed Oracle DATE to string ( non - null terminated exactly 19 characters )
void Str::OraDate2Str(unsigned char *ora_date, char *out)
{
	if(ora_date == NULL || out == NULL)
		return;
	int c = ((int)ora_date[0]) - 100;
	int y = ((int)ora_date[1]) - 100;
	int m = (int)ora_date[2];
	int d = (int)ora_date[3];
	int h = ((int)ora_date[4]) - 1;
	int mi = ((int)ora_date[5]) - 1;
	int s = ((int)ora_date[6]) - 1;
	Str::Dt2Ch(c, out);
	Str::Dt2Ch(y, out + 2);
	out[4] = '-';
	Str::Dt2Ch(m, out + 5);
	out[7] = '-';
	Str::Dt2Ch(d, out + 8);
	out[10] = ' ';
	Str::Dt2Ch(h, out + 11);
	out[13] = ':';
	Str::Dt2Ch(mi, out + 14);
	out[16] = ':';
	Str::Dt2Ch(s, out + 17);
}
void Str :: OraDate2Str ( unsigned char * ora_date , char * out ) { if ( ora_date == NULL || out == NULL ) return ; int c = ( ( int ) ora_date [ 0 ] ) - 100 ; int y = ( ( int ) ora_date [ 1 ] ) - 100 ; int m = ( int ) ora_date [ 2 ] ; int d = ( int ) ora_date [ 3 ] ; int h = ( ( int ) ora_date [ 4 ] ) - 1 ; int mi = ( ( int ) ora_date [ 5 ] ) - 1 ; int s = ( ( int ) ora_date [ 6 ] ) - 1 ; Str :: Dt2Ch ( c , out ) ; Str :: Dt2Ch ( y , out + 2 ) ; out [ 4 ] = ' ' ; Str :: Dt2Ch ( m , out + 5 ) ; out [ 7 ] = ' ' ; Str :: Dt2Ch ( d , out + 8 ) ; out [ 10 ] = ' ' ; Str :: Dt2Ch ( h , out + 11 ) ; out [ 13 ] = ' ' ; Str :: Dt2Ch ( mi , out + 14 ) ; out [ 16 ] = ' ' ; Str :: Dt2Ch ( s , out + 17 ) ; }
Convert 7-byte packed Oracle DATE to string (non-null terminated, exactly 19 characters)
Convert 7 - byte packed Oracle DATE to string ( non - null terminated exactly 19 characters )
// Unsigned required for proper conversion to int // Get string representation