Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はここで初めてです。「1024」と「2255」の値を持つ文字列の配列を時間値に変換することに行き詰まっています。
文字列を「10:24 AM」の形式で時刻に変換する必要があります。どうすればいいですか?
前もって感謝します。
このようなもの(私の頭から):
var myString = "2255"; var dateTime = DateTime.ParseExact(myString,"HHmm", System.Globalization.CultureInfo.CurrentCulture); var convertedString = dateTime.ToString("hh:mm tt");
convertedString「午後 10 時 25 分」のはずです
convertedString