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
DateTime value is returning US time format instead of UK.
eg
var strDateTime = "27/05/2019 07:20:00";
var actual = DateTime.ParseExact(strDateTime.Trim(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None);
Expected: 27/05/2019 07:20:00
Actual: 5/27/2019 7:20:00 AM
Steps to Reproduce
DateTime value is returning US time format instead of UK.
eg
var strDateTime = "27/05/2019 07:20:00";
var actual = DateTime.ParseExact(strDateTime.Trim(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None);
Expected: 27/05/2019 07:20:00
Actual: 5/27/2019 7:20:00 AM
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered:
Please see the documentation for the "language" settings in the configuration file. These only control the language to be used for the feature file and the language used when binding to Step Definition expressions. These have no effect on the thread's current culture setting (and thus won't affect how DateTime.Parse() operates).
@clrudolphi, thanks for the quick response, i thought Reqnoll uses similar config to specflow
with specflow settings as below, the bindingCulture config has an effect on the thread's current culture setting. When that is set i get the expected time based on the country set.
Reqnroll Version
2.2.1
Which test runner are you using?
MSTest
Test Runner Version Number
3.5.1
.NET Implementation
.NET 8.0
Test Execution Method
Visual Studio Test Explorer
Content of reqnroll.json configuration file
{
"$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",
"language": {
"feature": "en-UK",
"binding": "en-UK"
},
"bindingAssemblies": [
{
"assembly": "SharedStepDefinitions"
}
]
}
Issue Description
DateTime value is returning US time format instead of UK.
eg
var strDateTime = "27/05/2019 07:20:00";
var actual = DateTime.ParseExact(strDateTime.Trim(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None);
Expected: 27/05/2019 07:20:00
Actual: 5/27/2019 7:20:00 AM
Steps to Reproduce
DateTime value is returning US time format instead of UK.
eg
var strDateTime = "27/05/2019 07:20:00";
var actual = DateTime.ParseExact(strDateTime.Trim(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None);
Expected: 27/05/2019 07:20:00
Actual: 5/27/2019 7:20:00 AM
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered: