Spire.XLS is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Mon Dec 27, 2010 1:30 am

I require a date formatted as "dd/mm/yyyy" regardless of culture, and have tried the following with the current date.

The current date is 18/10/2010 i.e. 18th October 2010.
Both of the following formatting attempts end up with a result of "18/00/2010", not "18/10/2010" as expected i.e. the month is being set to "00", not '10" as it should be.

Why is this happening? it is driving me crazy. :x

Dim DateString as string
DateString = Date.Today.ToString("dd/mm/yyyy")
DateString = String.Format("{0:dd/mm/yyyy}", Date.Today)

Posts: 5
Joined: Mon Dec 27, 2010 1:24 am

Mon Dec 27, 2010 8:50 am

mm is minutes.

MM is Months.
e-iceblue support
User avatar

iceblue support
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS