Need To Convert Time
-
hello... i am working in a web application .i need to convert the time like... 5.00PM To 1700 6.10PM To 1810 12.00PM TO 2400 etc... if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this... Thanks in Advance
-
hello... i am working in a web application .i need to convert the time like... 5.00PM To 1700 6.10PM To 1810 12.00PM TO 2400 etc... if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this... Thanks in Advance
Something like this:
public static string ConvertTimeString(string time)
{
return DateTime.ParseExact(
time,
"h.mmtt",
CultureInfo.InvariantCulture).ToString("HHmm");
}Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
hello... i am working in a web application .i need to convert the time like... 5.00PM To 1700 6.10PM To 1810 12.00PM TO 2400 etc... if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this... Thanks in Advance
merahul wrote:
12.00PM TO 2400
What? That's not right. Are you talking about user input? Why not have the user enter the data in the format you require?
-
hello... i am working in a web application .i need to convert the time like... 5.00PM To 1700 6.10PM To 1810 12.00PM TO 2400 etc... if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this... Thanks in Advance
-
J4amieC wrote:
there is no 24:00 in 24h time
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
J4amieC wrote:
there is no 24:00 in 24h time
There is in ISO 8601 (but I don't see why anyone would specify it).
-
J4amieC wrote:
there is no 24:00 in 24h time
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
It may have its uses, but I haven't needed it yet.