コード例 #1
0
ファイル: FuncSrv.cs プロジェクト: DCSUser1/eGovPhase2
        public string FormatCobolDate(string strVal, int intLen)
        {
            CString r = string.Empty;

            strVal = strVal.Replace("-", "");
            strVal = strVal.Replace("/", "");
            strVal = strVal.Replace(".", "");
            strVal = SetValue(strVal, 8);

            r += VB.Right(strVal, 4);     //gets year
            r += VB.mid(strVal, 1, 2);    //gets month
            r += VB.mid(strVal, 3, 2);    //gets date


            return(r.ToString());
        }
コード例 #2
0
ファイル: FuncSrv.cs プロジェクト: DCSUser1/eGovPhase2
        public string FormatCobolDate(string strVal, int intLen)
        {
            string  strDate;
            CString r = string.Empty;

            if (string.IsNullOrEmpty(strVal))
            {
                //FormatCobolDate = SetValue(strVal,intLen)
            }
            else
            {
                strVal = strVal.Replace("-", ""); //Replace(strVal,"-","")
                strVal = strVal.Replace("/", ""); //Replace(strVal,"/","")
                strVal = strVal.Replace(".", ""); //Replace(strVal,".","")
                strVal = SetValue(strVal, 8);     //SetValue(strVal,8)

                //r = Right(strVal, 4) & Mid(strVal, 1, 2) & Mid(strVal, 3, 2);

                r += VB.Right(strVal, 4);  //gets year
                r += VB.mid(strVal, 1, 2); //gets month
                r += VB.mid(strVal, 3, 2); //gets date
            }
            return(r.ToString());
        }