Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i am getting 'time data' from One of my Db table time column like this '09:22:74.5300000'

How can i make it to only hh:mm:ss in rdlc report column

i already applied format column as hh:mm:ss , but it is showing like '09:22:74.5300000' . . . :@


how can i get out of this ?
Posted
Comments
Shweta N Mishra 17-Nov-14 6:26am    
Limit the number of character selection, Use substring etc.

1 solution

Assuming that this is a string field, with very basic error handling:

C#
public string FormatTime(string toFormat)
{
    var temp = toFormat.Split(new[] {'.'}, StringSplitOptions.None);
    return (temp.Count >0) ? temp[0] : string.Empty;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900