Esempio n. 1
0
        public DateTime GetDateTime(OciHandle handle, OciErrorHandle errorHandle)
        {
            short year  = 0;
            byte  month = 0;
            byte  day   = 0;
            byte  hour  = 0;
            byte  min   = 0;
            byte  sec   = 0;
            uint  fsec  = 0;
            int   fs    = 0;

            OciCalls.OCIDateTimeGetDate(handle, errorHandle, this.Handle,
                                        out year, out month, out day);
            OciCalls.OCIDateTimeGetTime(handle, errorHandle, this.Handle,
                                        out hour, out min, out sec, out fsec);

            // a TIMESTAMP can have up to 9 digits of millisecond but DateTime only
            // can be up to 999.
            if (fsec > 0)
            {
                int fseci = (int)fsec;
                fs = fseci / 1000000;
            }

            return(new DateTime(year, month, day, hour, min, sec, fs));
        }