Reputation: 15925
I am returning a date from my database table:
objSQLDataReader("date")
Which gives me:
31/05/2011 16:00:50
How do I change this to:
31 May 2011
?
Upvotes: 0
Views: 2149
Reputation: 32841
I think it would be a lot easier to format it in your SQL than to deal with it afterward.
SELECT CONVERT(varchar(25),GETDATE(), 106)
Here's a whole list of date formatting choices.
Upvotes: 1
Reputation: 57956
((DateTime)objSQLDataReader("date")).ToString("dd MMMM yyyy")
Upvotes: 3