John Woodsmall Active Member Licensed User Longtime User Nov 5, 2015 #1 I am trying to input a time using the datepicker. It returns 1:00:00 from: Sub lbltime_click date_index = 2 DatePicker1.Mode = DatePicker1.MODE_TIME DatePicker1.Visible = True DatePicker1.Ticks = DateTime.DateParse("12/08/1942") DatePicker1.Left=5 DatePicker1.Top=250 Button12.Visible = True Button2.Visible = True End Sub ' ' this is the retrun button after time selected ' Sub Button12_click Button12.Visible = False Button2.Visible = False DatePicker1.Visible = False If date_index = 1 Then lblfirstDate.Text = " " & DateTime.Date(DatePicker1.Ticks) Else LblTime.Text =" " & DateTime.Time(DatePicker1.MODE_TIME) End If End Sub
I am trying to input a time using the datepicker. It returns 1:00:00 from: Sub lbltime_click date_index = 2 DatePicker1.Mode = DatePicker1.MODE_TIME DatePicker1.Visible = True DatePicker1.Ticks = DateTime.DateParse("12/08/1942") DatePicker1.Left=5 DatePicker1.Top=250 Button12.Visible = True Button2.Visible = True End Sub ' ' this is the retrun button after time selected ' Sub Button12_click Button12.Visible = False Button2.Visible = False DatePicker1.Visible = False If date_index = 1 Then lblfirstDate.Text = " " & DateTime.Date(DatePicker1.Ticks) Else LblTime.Text =" " & DateTime.Time(DatePicker1.MODE_TIME) End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2015 #2 Please use [code]code here...[/code] tags when posting code. DateTime.Time expects a ticks value which represents the specific time instance. Code: Copy lblTime.Text = " " & DateTime.Time(DatePicker1.Ticks) Upvote 0
Please use [code]code here...[/code] tags when posting code. DateTime.Time expects a ticks value which represents the specific time instance. Code: Copy lblTime.Text = " " & DateTime.Time(DatePicker1.Ticks)
John Woodsmall Active Member Licensed User Longtime User Nov 6, 2015 #3 what is to go in date_index: DatePicker1.Ticks = DateTime.DateTimeParse(date_index) that is all i need? right? Upvote 0
what is to go in date_index: DatePicker1.Ticks = DateTime.DateTimeParse(date_index) that is all i need? right?