I am trying to create somewhat of a time clock program. When the user punches in, I need the current time to round to the nearest 15 minute interval. For example, if a user punches in at 6:50 am, it needs to write to the database 7:00 am. If a user punches in at 8:05, it needs to read 8:15.
I have tried using
todayDate = Convert.ToInt32(Today())
If Not (todayDate Mod 15 = 0) Then
do something with it code here
End If
But I get a conversion error where I cannot convert datetime to Integer.
My question is, how do I round the current time up or down to the nearest 15 minute interval?
Thanks so much.
I have tried using
todayDate = Convert.ToInt32(Today())
If Not (todayDate Mod 15 = 0) Then
do something with it code here
End If
But I get a conversion error where I cannot convert datetime to Integer.
My question is, how do I round the current time up or down to the nearest 15 minute interval?
Thanks so much.