Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

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)

lilyed72
 
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