-
December 13th, 2012, 10:33 PM
#1
[RESOLVED] how to convert a string to date format?
Hi All,
I have a string like this '20051022'(YYYYMMDD). I want to convert into '10/22/2005'(MM/DD/YYYY). Can anybody suggest on this?
Thanks in advance
-
December 13th, 2012, 11:45 PM
#2
Re: how to convert a string to date format?
Code:
string initial = "20051022";
string final = initial.substring(4,2) + "/" + initial.substring(6,2) + "/" + initial.substring(0, 4);
Learn more about string operations by reading this tutorial: http://www.techotopia.com/index.php/...ngs_in_C_Sharp
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
-
December 13th, 2012, 11:50 PM
#3
Re: how to convert a string to date format?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|