When want to show forward slash (’/') in date, I use the code below:
Format(Now,"dd/MM/yyyy")
However above code will return 31-01-2008, this is because forward slash “/” will replace by default separator in local PC if default date seperator is “-”.
To check your default date seperator, go to : Control Panel->Regional Settings->Customize->Date-> “Date seperator” in Short date format
You would not see the problem if your local PC date seperator is “/”.
In order to ensure system print the forward slash in date,use the code below:
Format(Now,"dd\/MM\/yyyy")
The code will give 31/01/2008 no matter what is the date seperator.
Reference: http://support.microsoft.com/kb/102045
Search Keyword: Date, slash, seperator
[...] Display forward slash (’/’) in date using C# Not sure whether you still remember my previous post:- Display forward slash (’/’) in date under VB6 [...]
By: Display forward slash (’/’) in date using C# « 大脚板日记 on January 17, 2009
at 4:08 pm