DateTime date = new DateTime(1970, 1, 15);
string sdate = date.ToString(value_i_will_forget as string,
CultureInfo.InvariantCulture);
// some lines later
string format_string = MagicParse(sdate,
CultureInfo.InvariantCulture);
I have an arbitrary date that I write to a string with CulturInfo.InvariantCulture
. The .Net format I use - "d"
, for example - is now forgotten.
I do know however that the string hasn't changed, its still valid and its still with invariant culture. Im looking for the MagicParse
function to extract the format string used to write the formatted date.