[RESOLVED] Plussing one minute...
Code:
Private Function GetTimePlus(Time_ As String) As String
Dim Time_Split() As String
Dim Meridiam As String
Time_Split() = Split(Time_, ":")
Meridiam = Right(Time_, 2)
'Time_Split(1) = Format(Left(Time_Split(1), 2), "##")
Time_Split(1) = Time_Split(1) + 1
If Time_Split(1) >= 60 Then
Time_Split(0) = Time_Split(0) + 1
Time_Split(1) = "00"
If Time_Split(0) = 12 Then
If Meridiam = "AM" Then
Meridiam = "PM"
Else
Meridiam = "AM"
End If
End If
End If
If Time_Split(0) > 12 Then
Time_Split(0) = 1
End If
GetTimePlus = Format(Time_Split(0), "##") & ":" & Format(Time_Split(1), "##") & ":" & Format(Time_Split(2), "##") & " " & Meridiam
End Function
This keeps returning strings like "1:5:1 AM"
Local Time here is 1:06:00 AM
I'm trying to plus one minute onto the current time.
Re: Plussing one minute...
It is much easier to use the built-in functions, such as DateAdd:
Code:
NewTime = DateAdd("n",1, Time)
"n" is to say you want to add miNutes, 1 for the amount, and Time for the value (the current time) that you want to add it to.
Re: Plussing one minute...
Oh dude i love you. In the most professional way possible of course.
I never knew about that!
Re: [RESOLVED] Plussing one minute...
si_the_geek u r great man,what ever i say to praise u is less,briliant man briliant