|
-
Feb 24th, 2000, 05:00 AM
#1
Thread Starter
Member
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
-
Feb 24th, 2000, 05:11 AM
#2
Member
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
-
Feb 24th, 2000, 05:12 AM
#3
Fanatic Member
I'm not sure if this works the same way but you could use Format Function:
Format(Date, "dddd")
HTH
-
Feb 24th, 2000, 05:14 AM
#4
Frenzied Member
Try this...
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:
Code:
Option Explicit
Private Sub Form_Load()
Label1 = Format(Date, "dddd")
End Sub
Run the project, and the label will contain the current day of the week (based on the system time/date).
Hope that helps,
~seaweed
-
Feb 24th, 2000, 05:18 AM
#5
Member
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
-
Feb 24th, 2000, 07:23 AM
#6
Thread Starter
Member
Thanks for all your help...
Scott
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|