DateTime.ToString(“MM/dd/yyyy HH:mm:ss.fff”) resulted in something like “09/14/2013 07.20.31.371”

后端 未结 6 1968
旧巷少年郎
旧巷少年郎 2020-12-22 20:08

I have a WP8 app, which will send the current time to a web service.

I get the datetime string by calling

DateTime.ToString(\"MM/dd/yyyy HH:mm:ss.ff         


        
6条回答
  •  感动是毒
    2020-12-22 21:04

    Convert Date To String

    Use name Space

    using System.Globalization;
    

    Code

    string date = DateTime.ParseExact(datetext.Text, "dd-MM-yyyy", CultureInfo.InstalledUICulture).ToString("yyyy-MM-dd");
    

提交回复
热议问题