Oracle
 sql >> Database >  >> RDS >> Oracle

C# DateTime cambia in un altro formato

Puoi utilizzare DateTime.TryParseExact per datetime personalizzata formato come:

 string strDateStarted = "19-MAR-13 08.13.27 AM";
 DateTime datDateStarted;
 DateTime.TryParseExact(strDateStarted, new string[] { "dd-MMM-yy hh.mm.ss tt" }, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out datDateStarted);
 Console.WriteLine(datDateStarted);