// sets val as TimeSpan with Oid oid PqsqlDbType.Time into pqparam_buffer pb internal static void SetTime(IntPtr pb, object val, PqsqlDbType oid) { TimeSpan ts = (TimeSpan)val; int hour; int min; int sec; int fsec; PqsqlBinaryFormat.GetTime(ts, out hour, out min, out sec, out fsec); PqsqlBinaryFormat.pqbf_add_time(pb, hour, min, sec, fsec); }
// adds o as TimeSpan array element into PQExpBuffer a internal static void SetTimeArray(IntPtr a, object o) { TimeSpan ts = (TimeSpan)o; int hour; int min; int sec; int fsec; PqsqlBinaryFormat.GetTime(ts, out hour, out min, out sec, out fsec); PqsqlBinaryFormat.pqbf_set_array_itemlength(a, 8); PqsqlBinaryFormat.pqbf_set_time(a, hour, min, sec, fsec); }
public int WriteTime(TimeSpan value) { long begin = LengthCheckReset(); int hour; int min; int sec; int fsec; PqsqlBinaryFormat.GetTime(value, out hour, out min, out sec, out fsec); PqsqlBinaryFormat.pqbf_set_time(mExpBuf, hour, min, sec, fsec); unsafe { sbyte *val = PqsqlBinaryFormat.pqbf_get_bufval(mExpBuf) + begin; return(PutColumn(val, 8)); } }