here's one way to do it
Public Class Form1
'make a date variable
Dim theDate As New DateTime
''' <summary>
''' form load handler
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'get the date and time and put it in the variable
theDate = Now
End Sub
''' <summary>
''' button click handler
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnFullDateTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFullDateTime.Click
'with date and time
MsgBox(theDate)
End Sub
''' <summary>
''' button click handler
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnTimeWithSeconds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeWithSeconds.Click
'get the time portion of theDate and split it on the "." to remove the milliseconds, return the 0 index item of the string array
MsgBox(theDate.TimeOfDay.ToString.Split(".")(0))
End Sub
''' <summary>
''' button click handler
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnTimeWithoutSeconds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeWithoutSeconds.Click
'displays the time with only hours and minutes
MsgBox(theDate.TimeOfDay.ToString.Split(":")(0) & ":" & theDate.TimeOfDay.ToString.Split(":")(1))
End Sub
End Class
so as you can see, i basically just handled it like a string and parsed out the part of it i wanted in each case.
one button displays the full date and time
another button displays time only, with seconds
and the third button displays time only, without seconds
I'm not going to code the whole program, I'll leave the retrieval of the datetime object from the MSAccess Database up to you, but here is how you can manipulate it once you've retrieved it to get the value you desire out of it.
cheers :banana: