Reputation: 567
Just wondering if someone could please point me in the right direction.
In my SQL database, I have a Date column, and the format of the date is:
yyyy/MM/dd - e.g. 2014/07/31
I want to keep this format in my SQL database.
However, when I query it through my VB NET project I want to display the date in a different format.
dd/MM/yyyy - e.g. 31/07/2014
Is there anyway to do this through .NET as opposed to doing the conversion through SQL?
If someone can help that would be greatly appreciated.
Thank you for your time.
Upvotes: 1
Views: 5627
Reputation: 20415
Take a look at the Custom Date and Time Format Strings:
someDate.ToString("MM/dd/yyyy")
Upvotes: 4