View Single Post
Old Feb 5th, 2005, 4:27 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Dates and Things

VB6 makes it delightfully easy to work with dates (that is until some-time in 2030 when the dates will do another millennium bug thing) - use the built in Date type (actually holds time and date, not just date), and you can manipulate it like so:
Dim MyDate as Date
MyDate = "January 17, 1988" ' String date
MsgBox MyDate
MyDate = Vba.Now ' Current Time/Date
MsgBox "This is the " & Vba.Day(MyDate) & " of the month" ' Example of built in date function
MyDate = DateAdd("d",12,MyDate)
MsgBox "Twelve Days from now will be " & MyDate
Most other methods should be obvious, though have a look at the Object Inspector or MSDN if you get stuck.
Rory is offline   Reply With Quote