i want to use the fucntion GetTimeOfTheDay function
but i dont know how to
i looked everywhere on msdn, but coundt find anything useful
if you know how please let me know
that gives me error saying no function defined..Code:GetTimeOfDay()
Printable View
i want to use the fucntion GetTimeOfTheDay function
but i dont know how to
i looked everywhere on msdn, but coundt find anything useful
if you know how please let me know
that gives me error saying no function defined..Code:GetTimeOfDay()
According to my MSDN this is a Java Function.
There is no GetTimeOfDay api function. You'll have to use the Time function vb has.
But you can turn it into a function:
Code:Private Function GetTimeOfDay() As String
GetTimeOfDay = Time
End Function
Usage:
Msgbox GetTimeOfDay
well since i coudn't find one that ms made
i thought i make my own
here it is if anyone else needs it
change the values based on what time you think evening, morning, afternoon ect startCode:Public Function GetTimeOfDay() As String
Dim theHour As Integer
theHour = Hour(Time)
If Val(theHour) <= 23 And Val(theHour) >= 16 Then
GetTimeOfDay = "evening"
ElseIf Val(theHour) < 16 And Val(theHour) >= 12 Then
GetTimeOfDay = "afternoon"
ElseIf Val(theHour) >= 0 And Val(theHour) <= 11 Then
GetTimeOfDay = "morning"
Else
GetTimeOfDay = "early morning"
End If
End Function