Hello...
Thanks for all the help on my previous questions...
I am trying to figure out what day of the week it is according to system time.
Is there a simple function that does this?
Thanks,
Scott
Printable View
Hello...
Thanks for all the help on my previous questions...
I am trying to figure out what day of the week it is according to system time.
Is there a simple function that does this?
Thanks,
Scott
Hey-Not super simple, but:
In a module put:--------------------
Declare Sub GetSystemTime Lib "kernel32" Alias_ "GetSystemTime" (lpSystemTime As SYSTEMTIME)
Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Public tTIME as SYSTEMTIME
then, to call it use
GetSystemTime tTIME
then you can use tTIME.wDayOfWeek
it will give you a number,1=monday 2=tues, etc.
Hope This Helps,
Thnx For Your Time,
CarlosTheJackal
I'm not sure if this works the same way but you could use Format Function:
Format(Date, "dddd")
HTH
Here's one way to get the current day of the week...
Drop a label (Label1) on a form and put the following into the form's code window:
Run the project, and the label will contain the current day of the week (based on the system time/date).Code:Option Explicit
Private Sub Form_Load()
Label1 = Format(Date, "dddd")
End Sub
Hope that helps,
~seaweed
Wow,i had no idea there was an easier way to do that :O dont i feel stupid now :P
Thnx For Your Time,
CarlosTheJackal
Thanks for all your help...
Scott