Hi,
I want to separate the value like this
InputString = “07:00 am”
And i need output is
Hours = 07
Minutes = 00
Am/pm = AM
Anyone can help for the same
Thanks in advance
Regards,
Shriharsha H N
Hi,
I want to separate the value like this
InputString = “07:00 am”
And i need output is
Hours = 07
Minutes = 00
Am/pm = AM
Anyone can help for the same
Thanks in advance
Regards,
Shriharsha H N
Hi,
Hope the following helps you.
text = "07:00 am"
strHour = text.Split({":"c," "c})(0)
strMinute = text.Split({":"c," "c})(1)
strAMPM = text.Split({":"c," "c})(2)
OR
strHour = DateTime.Parse(text).ToString("hh")
strMinute = DateTime.Parse(text).ToString("mm")
strAMPM = DateTime.Parse(text).ToString("tt")
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.