欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

自定義時(shí)間格式轉(zhuǎn)換代碼分享

 更新時(shí)間:2013年12月26日 15:56:25   作者:  
自定義時(shí)間格式轉(zhuǎn)換,如"2012年5月14日"的日期字符串,大家參考使用吧

復(fù)制代碼 代碼如下:

/// <summary>
        /// 將日期字符串轉(zhuǎn)換為日期類型
        /// </summary>
        /// <param name="strDateTime">形如"2012年5月14日"的日期字符串</param>
        private DateTime ParseDateTime(string strDateTime)
        {
            ////Like: string strDateTime = "2012年5月14日";
            DateTime dateTime;
            if (DateTime.TryParseExact(strDateTime, "yyyy年M月d日", new System.Globalization.CultureInfo("en-US"), System.Globalization.DateTimeStyles.AssumeLocal, out dateTime))
            {
                return dateTime;
            }
            else
            {
                return DateTime.Today;
            }
        }

相關(guān)文章

最新評(píng)論