Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net issue with date format

Hi

I am using the following code in a standard module. From any form in my project
I call the function with eg S = DateString(Me.DateTimePicker1.Value.Date)
but the string comes back with eg "2013-00-08". I am not sure why zeros appear for the month

Function DateString(, ByVal oDate As Date) As String
                DateString = oDate.ToString("yyyy-mm-dd")
End Function
ASKER CERTIFIED SOLUTION
Avatar of SStory
SStory
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much