コード例 #1
0
ファイル: TdrTypeUtil.cs プロジェクト: isoundy000/wzry-1
        public static TdrError.ErrorType tdrDateTime2Str(ref TdrVisualBuf buf, ulong datetime)
        {
            TdrDateTime time = new TdrDateTime();

            if (time.parse(datetime) == TdrError.ErrorType.TDR_NO_ERROR)
            {
                object[] args = new object[] { time.tdrDate.nYear, time.tdrDate.bMon, time.tdrDate.bDay, time.tdrTime.nHour, time.tdrTime.bMin, time.tdrTime.bSec };
                return(buf.sprintf("{0:d4}-{1:d2}-{2:d2} {3:d2}:{4:d2}:{5:d2}", args));
            }
            return(TdrError.ErrorType.TDR_ERR_INVALID_TDRDATETIME_VALUE);
        }
コード例 #2
0
        public static TdrError.ErrorType tdrDateTime2Str(ref TdrVisualBuf buf, ulong datetime)
        {
            TdrDateTime tdrDateTime = new TdrDateTime();

            TdrError.ErrorType result;
            if (tdrDateTime.parse(datetime) == TdrError.ErrorType.TDR_NO_ERROR)
            {
                result = buf.sprintf("{0:d4}-{1:d2}-{2:d2} {3:d2}:{4:d2}:{5:d2}", new object[]
                {
                    tdrDateTime.tdrDate.nYear,
                    tdrDateTime.tdrDate.bMon,
                    tdrDateTime.tdrDate.bDay,
                    tdrDateTime.tdrTime.nHour,
                    tdrDateTime.tdrTime.bMin,
                    tdrDateTime.tdrTime.bSec
                });
            }
            else
            {
                result = TdrError.ErrorType.TDR_ERR_INVALID_TDRDATETIME_VALUE;
            }
            return(result);
        }