ให้เซตค่า
CurrentCulture to format the DateTime object
protected void Page_Load(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR"); //set the current thread culture to fr-FR
DateTimeFormatInfo fmi = Thread.CurrentThread.CurrentCulture.DateTimeFormat;
string shortDataPattern = fmi.ShortDatePattern; //check this pattern, it's "dd/MM/yyyy"
string shortDateString = System.DateTime.Now.ToShortDateString(); //DateFormatPattern is dd/MM/yyyy [15/06/2011]
}
ข้อมูลเพิ่มเติม
http://msdn.microsoft.com/en-us/library/5hh873ya.aspx
http://www.technoreader.com/SQL-Server-Date-Time-Format.aspx
Supa Sethasiripong [MSFT]
MSDN Community Support |
Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.