Hello, I am witting some software to interact with a mail order manager. Issue is they use a strange date/time format that they store as text in the DB, from what i guessed its YYYYMMDDHHMMSSNNN
right now im using this function to get it into C# as a standard date.
private static DateTime ProcessMwTime(string mwTime)
{
//Mailware Date Format
//YYYY/MM/DD HH:MM:SS.NNN
//20090916114135766
//2009/09/16 11:41:35.766
DateTime thisDate = new DateTime(int.Parse(mwTime.Substring(0, 4)),
int.Parse(mwTime.Substring(4, 2)),
int.Parse(mwTime.Substring(6, 2)),
int.Parse(mwTime.Substring(8, 2)),
int.Parse(mwTime.Substring(10, 2)),
int.Parse(mwTime.Substring(12, 2))
);
return thisDate;
}
Now the question, is there a better way to do this. to me it looks lame to have to read it like that.
Thanks
Don