Results 1 to 6 of 6

Thread: Day of the week?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    44

    Post

    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

  2. #2
    Member
    Join Date
    Feb 1999
    Location
    ,Mo,USA
    Posts
    36

    Post

    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

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    I'm not sure if this works the same way but you could use Format Function:
    Format(Date, "dddd")
    HTH

  4. #4
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Post 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

  5. #5
    Member
    Join Date
    Feb 1999
    Location
    ,Mo,USA
    Posts
    36

    Post

    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

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    44

    Post

    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
  •  



Click Here to Expand Forum to Full Width