You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if you are located in special countries (Germany for example, but a lot more), the line timestamp = String.Concat(dt.ToString("MMM "), day, dt.ToString(" HH:mm:ss"));
could result in month names like "Mrz", "Dez"...
They are not valid!
This is easily solvable by adding CultureInfo.InvariantCulture as 2nd parameter of DateTime.toString:
The month of a Syslog timestamp is defined as one of these values: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec (https://tools.ietf.org/html/rfc3164#section-4.1.2)
But if you are located in special countries (Germany for example, but a lot more), the line
timestamp = String.Concat(dt.ToString("MMM "), day, dt.ToString(" HH:mm:ss"));
could result in month names like "Mrz", "Dez"...
They are not valid!
This is easily solvable by adding
CultureInfo.InvariantCulture
as 2nd parameter ofDateTime.toString
:timestamp = String.Concat(dt.ToString("MMM ", CultureInfo.InvariantCulture), day, dt.ToString(" HH:mm:ss", CultureInfo.InvariantCulture));
The text was updated successfully, but these errors were encountered: