C# datetime format change

前端 未结 3 495
天涯浪人
天涯浪人 2021-01-27 05:25

I want to convert datetime.now format which is \"dd/mm/yyyy hh:mm:ss AM/PM\" to US time format i.e. \"mm-dd-yyyy hh:mm:ss AM/PM\". More over i

3条回答
  •  独厮守ぢ
    2021-01-27 06:07

    Try this. Standard Date and Time Format Strings

    DateTime.Now.ToString("g",CultureInfo.CreateSpecificCulture("en-us"))
    

提交回复
热议问题