I have a DataTable with a DataColulmn of TimeSpan type. It gets filled with a time column in a SQL Server query, and it shows as a 24 hr format on screen. I wanted to show it as a 12 hr format + am/pm using an expression column, but coulnd't do it. I tried using convert to the column to handle the string, but it shows a strange format such as PT20H15 (that would be 20:15 or 8:15 pm). As the position of time and hour changes if the hour is one or two digits, and if hour is 00 then it get removed, string handling seems like too complicated. I tried just comparing the column value like "HourCol > 12" but that raises an error regarding comparing timespan to int, so I failed again. Does anyone have a different suggestion?
Thanks in advance.