Link to home
Start Free TrialLog in
Avatar of amukta
amukta

asked on

how do i convert a date from the format mmddyyhhmiss to yyyymmdd-hh24miss-very urgent

how do i convert a date from the format mmddyyhhmiss to yyyymmdd-hh24miss-very urgent
ASKER CERTIFIED SOLUTION
Avatar of AlexNek
AlexNek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexNek
AlexNek

Something like
//mmddyyhhmin
string dateString = "031820070915";
IFormatProvider culture = new CultureInfo("en-US", true);
DateTime dt = DateTime.ParseExact(dateString, "MMddyyhhmm", culture);
Console.WriteLine(dt);

//yyyymmdd-hh24min
Console.WriteLine(dt.ToString("yyyMMdd-HHmm"));

Avatar of amukta

ASKER

Thank you very much.It helped me a lot
Avatar of amukta

ASKER

Thank you very much
Avatar of amukta

ASKER

THnak you very much
You are welcome. Thank you too.