Its better to use a standard neutral format irrespective of any Regional, Language .. settings.
Use the following format for datetime. If you input your datetime in unseparated or ISO 8601 format shown below, then you should not worry about any configuration/settings:
Unseparated = 'yyyymmdd hh:mm:ss'
ISO 8601 = 'yyyy-mm-ddThh:mm:ss'
The ISO 8601 format has the advantage of being defined in an international standard.
And you can pass this format using ToString()
method, when handling datetime values:
lblDateTime.Text = (DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss"));
This got various advantages as it doesn't needs to check/change settings of Operating System, Database servers ... Continue reading here.