I've an exception in executing DateTime.Now on a Pico5 with WEC2013
Any hint?
PicoCom 5
-
-
Found the problem. Was a bad registry key.
-
-
I've noticed that if I set a timezone different from the default I can't set the Date and Time in the desidered form.
I need to set the Date And Time in the format dd/MM/yyyy hh:mm without AM or PMIf I set the date in the format MM/dd/yyyy there is no problem, but I want to use the dd/MM/yyyy.
I put a little sample program.
Could you tell me what registry key I have to set to make it work? -
This is the Exception
-
Hello,
the format changes with the active culture. Evaluate "TimezoneInfo" and/or "CultireInfo" should resolve the problem.Maybe you can use this easy workaround:
QuoteDateTime dt = DateTime.Now;
// Current format depends on active culture
string s1 = dt.ToString();
// Format dt-string to your desire
string s2 = dt.ToString("dd/MM/yyyy");...
Debug.Write(s1);
Debug.Write("\r\n");
Debug.Write(s2);
resultsQuote7/31/2015 1:13:36 AM
31/07/2015
Note, this is only one sample format, there are a lot of other possibilities like "dd.MM.yyyy", ... .