ra294 wrote:
> When I use the Now() Fucntion i my ASP.net application I get a date
> format of mm/dd/yy.
> I want it to be dd/mm/yy. I set in the web config "culture="en-GB"
> uiCulture="en" and also set the regional setting of the computer.
> When I am checking "Thread.CurrentThread.CurrentCulture" I can see
> it's "en-GB" and the date format is like I want it (dd/mm/yy), but
> still the Now() function gives me mm/dd/yy format.
> How do I correct this problem ?
>
> Thanks
>
>
DateTime.Now doesn't give a "mm/dd/yyyy" string, it gives a DateTime value.
When you do a ToString() on that DateTime value, you might get
a "mm/dd/yyyy" string. The debugger also shows the result of ToString().
You might try setting the CurrentUICulture, but in this particular case
there is another option: use ToString("dd/MM/yyyy") (use capital MM
to get month, lowercase mm returns minutes)
By the way, if you are only interested in the date, you can also use
DateTime.Today.
Hans Kesting