Pam,
Define "fastest", I would be more concerned with the "proper" way of doing
it.
If I had a date in d/m/y format & wanted m/d/y or y/m/d formats I would
simply use DateTime.Parse & DateTime.ToString. As Parse & ToString are the
"proper" ways of doing (who better then the type itself to have convert to &
from various formats).
Something like:
Const dmy As String = "d/M/yyyy"
Const mdy As String = "M/d/yyyy"
Const ymd As String = "yyyy/M/d"
Dim european As String = "30/4/2006"
Dim someDate As Date = DateTime.ParseExact(european, dmy, Nothing)
Dim usa As String = someDate.ToString(mdy)
Dim asian As String = someDate.ToString(ymd)
NOTE: Convert.ToString & Convert.ToDateTime ultimately call DateTime.Parse &
DateTime.ToString...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
|A quick question,
|
| I have a string with a date in european format, e.g. "30/4/2006".
|
| What is the FASTEST way to produce the corresponding string in USA
| format
| "4/30/2006" and asian format "2006/4/30" ?
|
| -pam
|