Date function

izen

Registered User.
Local time
Today, 19:08
Joined
Apr 2, 2009
Messages
50
I am using Date to be a part of my file name

so I used strDate = Replace(date,"/",".")

so I can avoid "/" in my file name

However I am not sure that any computer or OS the default of Date is
date/month/year or not cause if not my code wont work on others

just want u guys to make sure that the default of Date is
date/month/year

thanks
 
Hi,
Instead of using replace use format as follows:

strDate = Format(Date, "dd-mm-yyyy")

You can then put the d's, m's and y's where ever you like to create your own date format.

Regards
JD
 
oohh thanks James :)
 
Tip:
Dont use the DD-MM-YYYY format, as it messes with your ordering if you look at the files.

If you are using dates as string (or filename) anywhere ALWAYS use the ISO format: YYYYMMDD
or YYYY-MM-DD if you prefer.

Same with time, if you need to add hours/mins just append to the back
YYYYMMDDHHNNSS
Or somthing simular...

Good luck !
 

Users who are viewing this thread

Back
Top Bottom