I need a variable that stores just a date and not the time. I also need the date to be stored in a certain format, YYYY-MM-DD, 2005-01-10. I have looked at the following:
Dim d As Date
Debug.Write(d.Today)
Debug.Write(d.Now)
Debug.Write(d.Date)
look up the format command, there is tons of custom formating control on dates.
Also, the date is going to be stored in some arbitratry format (number of seconds since some date in the 1960s? what ever that deal is), so all you need to do is format the date when you need to interact with it (IE: Displaying it and saving it to a database)
You can also supply a format as a parameter to the ToString() method.
Chip H.
____________________________________________________________________ Click here to learn Ways to help with Tsunami Relief If you want to get the best response to a question, please read FAQ222-2244 first
thank you for the help, I have an add on question to this now. I want to display yesterdays date. I have the following code that diplays todays date in the format that I need. How can I alter this to display yesterdays date in the same format.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.