輸出格式為日期
DateTime.Now.ToString("MM/dd/yyyy").ToString(CultureInfo.GetCultureInfo("en-GB"))
"08/16/2013"
DateTime.Now.ToString("MMMM/dd/yyyy", CultureInfo.GetCultureInfo("en-GB"))
"August/16/2013"
DateTime.Now.ToString("MMMM-dd-yyyy", CultureInfo.GetCultureInfo("en-GB"))
"August-16-2013"
DateTime.Now.ToString("MMMM dd yyyy", CultureInfo.GetCultureInfo("en-GB"))
"August 16 2013"...
輸出格式為字串
DateTime.Now.ToString("D", CultureInfo.GetCultureInfo("en-GB"))
"16 August 2013"
不難,但要用的時候很容易臨時想不起來XD
沒有留言:
張貼留言