// sets val as TimeSpan with Oid oid PqsqlDbType.TimeTZ into pqparam_buffer pb internal static void SetTimeTZ(IntPtr pb, object val, PqsqlDbType oid) { TimeSpan ts = (TimeSpan)val; int hour; int min; int sec; int fsec; int tz; PqsqlBinaryFormat.GetTimeTZ(ts, out hour, out min, out sec, out fsec, out tz); PqsqlBinaryFormat.pqbf_add_timetz(pb, hour, min, sec, fsec, tz); }
// adds o as TimeSpan array element into PQExpBuffer a internal static void SetTimeTZArray(IntPtr a, object o) { TimeSpan ts = (TimeSpan)o; int hour; int min; int sec; int fsec; int tz; PqsqlBinaryFormat.GetTimeTZ(ts, out hour, out min, out sec, out fsec, out tz); PqsqlBinaryFormat.pqbf_set_array_itemlength(a, 12); PqsqlBinaryFormat.pqbf_set_timetz(a, hour, min, sec, fsec, tz); }
public int WriteTimeTZ(TimeSpan value) { long begin = LengthCheckReset(); int hour; int min; int sec; int fsec; int tz; PqsqlBinaryFormat.GetTimeTZ(value, out hour, out min, out sec, out fsec, out tz); PqsqlBinaryFormat.pqbf_set_timetz(mExpBuf, hour, min, sec, fsec, tz); unsafe { sbyte *val = PqsqlBinaryFormat.pqbf_get_bufval(mExpBuf) + begin; return(PutColumn(val, 12)); } }