How do I get the AM/PM value from a DateTime?

后端 未结 14 1582
刺人心
刺人心 2020-11-28 06:23

The code in question is below:

public static string ChangePersianDate(DateTime dateTime)
{
    System.Globalization.GregorianCalendar PC = new System.Globa         


        
14条回答
  •  遥遥无期
    2020-11-28 06:57

    Something like bool isPM = GetHour() > 11. But if you want to format a date to a string, you shouldn't need to do this yourself. Use the date formatting functions for that.

提交回复
热议问题