Click here to Skip to main content
15,881,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Convert this date format "20140415"(YYMMDD) in below date format
April'14.
This

Thannx.....
Posted
Updated 17-Mar-15 1:31am
v3
Comments
Er. Puneet Goel 17-Mar-15 7:16am    
where you want to perform this conversion ? server side or client side ? Please provide full details.
Thanks7872 17-Mar-15 7:29am    
See the tags. Sql is there.
Naveen Kumar Tiwari 17-Mar-15 7:34am    
This Format (20140403) IN my sql server table and I want to select date IN this format(April'14)

SQL
SELECT CONVERT(varchar, CONVERT(date, '20140415'), 106)


This will give you '15 Apr 2014'.

You can figure out how to convert that to Apr'14.
 
Share this answer
 
 
Share this answer
 
Solution :
C#
DateTime dates = DateTime.ParseExact("20140415", "yyyyMMdd", CultureInfo.InvariantCulture)
 
Share this answer
 
Comments
CHill60 17-Mar-15 7:32am    
That's not SQL. OP has not tagged C# anywhere
Er. Puneet Goel 17-Mar-15 7:34am    
ohh...yes i just misssed that :) Thanks for correcting

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900