文字列を5/4/2017 2:15:50 PMに変換してdatetimeに変換したい。私は使用しましたDateTime.ParseExactの書式文字列 - "tt"では何時書式が使用できますか?
statustime="5/4/2017 2:15:50 PM"
statustimefrm=DateTime.Parse(statustime, Globalization.CultureInfo.CurrentCulture)
それは働いたが、私はむしろParseExactを使用したいと思います。私は使用しました
statustimefrm=DateTime.Parse(statustime, "M/d/yyyy HH:mm:ss tt",Globalization.CultureInfo.CurrentCulture)
しかし、それは私にフォーマットエラーを与えました。誰も使用するフォーマットを知っていますか?
はDateTime.ParseExact(タイムスパン、 "M/D/YYYYの時間:分:秒のTT"、CultureInfo.InvariantCulture)にそれを変更私の作品; – Aparna