Sameer Khan

Sameer Khan

  • 1.9k
  • 260
  • 28.8k

Using DataType Datetime how can i get the date format in dd/

Jun 6 2018 12:06 AM
Using DataType Datetime how can i get the date format in dd/MM/yyyy while running on the local server getting in dd/MM/yyyy for but after publish on the server getting in MM/dd/yyyy format
 
I have tried
 
Without using DateTime.Now.ToString(), instead any variable
 
1. Convert.ToDateTime(TodayDate_Greater, System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);
 
2. DateTime.ParseExact(TodayDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);

Answers (4)