I have two parameters defined in appsettings.json of an asp.net core project.
"TimeParam": {
"StartTime": "00:00:00.0001",
"EndTime": "23:59:99.999"
"BackOffDay": 1
},
In a function, I need to pass two parameters as startDate and endDate of data type date.
For example, for the startDate I need to be like 17/06/2020 00:00:00.0001 and the endDate to be like 17/06/2020 23:59:99.999
How can I get to set the two variable as follows taking into consideration the time that I have set in the appsettings.json?
StartDate: DateTime.Now.AddDays(BackOffDay) EndDate: DateTime.Now
var startDate = DateTime.Parse($"{DateTime.Now.AddDays(BackOffDay):dd/MM/yyyy} {StartTime}");and similarly forendDate.