1
我想在我的asp.net MVC 3網站上顯示尼日利亞時間。我需要改變文化嗎?尼日利亞時間使用asp.net
目前,我使用的是這樣的:
@Model.ReportDate.ToString("hh:mm tt", System.Globalization.CultureInfo.InvariantCulture)
請建議。
謝謝。
我想在我的asp.net MVC 3網站上顯示尼日利亞時間。我需要改變文化嗎?尼日利亞時間使用asp.net
目前,我使用的是這樣的:
@Model.ReportDate.ToString("hh:mm tt", System.Globalization.CultureInfo.InvariantCulture)
請建議。
謝謝。
嘗試這樣做:
CultureInfo igNG = new CultureInfo("ig-NG"); //change according to specific Nigerian culture
@Model.ReportDate.ToString("c", igNG); //change 'c' to whatever format you want
CultureInvariant
不與任何特定國家或地區相關的,只是基於英語。