getting current date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manontheedge
    New Member
    • Oct 2006
    • 175

    getting current date

    I'm working on a program in VB6 and I need to be able to have the program display the current date ( actually, i just need the day number ), but I have no idea how to do this is VB...is there a built in function for this?

    if anyone can help, I'd appreciate it.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by manontheedge
    I'm working on a program in VB6 and I need to be able to have the program display the current date ( actually, i just need the day number ), but I have no idea how to do this is VB...is there a built in function for this?
    The function Now() returns the current time. You could use the Day function to get the day number. That would be...
    Code:
    Dim DayNumber As Integer
    DayNumber = Day( Now() )
    (Note, I think you can leave the parentheses off Now, as well.)

    You can also use the Format() function to return the day from a date/time value.

    Comment

    • manontheedge
      New Member
      • Oct 2006
      • 175

      #3
      thank you very much, that's exactly what I needed

      Comment

      Working...