How to get the time is AM or PM?

Hi,

I am getting the time in 24hrs format. How can i convert the given time in 12 hr format & convert to AM or PM?

Kindly help me with this. Thank You!

1 Like

maybe you are looking for this:
grafik

1 Like

Hi @sneha_arbole
Try to follow the thread as below:

Try this:-

formattedTime = DateTime.ParseExact(inputTime, “HH:mm”, CultureInfo.InvariantCulture).ToString(“hh:mm tt”)

If this works for you, please mark this as a solution so others can refer the same… :slight_smile:

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.