Is there a way to convert the Time into military Time? If the user
inputs 2:15 pm is there a way to convert it 14:15?
Thanks
Elissa
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
1pm + 12 = 13
2pm + 12 = 14
3:25pm + 12 = 15:25
...
11:59pm + 12 = 23:59
midnight starts at 00:00
12:00AM = 00:00
"Elissa Setarehshenas" <elissa...@yahoo.com> wrote in message
news:#Iiso1TyBHA.2228@tkmsftngp07...
Dim miltime As New DateTime()
Try
miltime = Convert.ToDateTime(TextBox1.Text)
Label1.Text = miltime.ToString("HH:mm:ss")
Catch exc As Exception
Label1.Text = "Problem: " & exc.Message
End Try
Does this help?
Ken
MVP [ASP.NET]
Public Class timemilitary
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim miltime As New DateTime()
Try
miltime = Convert.ToDateTime(TextBox1.Text)
Label1.Text = miltime.ToString("HH:mm:ss")
Catch exc As Exception
Label1.Text = "Problem: " & exc.Message
End Try
End Sub
End Class
"Elissa Setarehshenas" <elissa...@yahoo.com> wrote in message
news:#Iiso1TyBHA.2228@tkmsftngp07...
>
>