User-1355965324 posted
I want to compare the date coming from the data from a json file and with todays date. The data coming from json for example 17-07-2020 00:00:00 datetime value without time in it . how can I check with if condition
whether the date is todays date or not . I given the code as below but not working please help. DateTime.Now has time so that condition is failed
@for (var i = 0; i < Model.consolidated_weather.Count(); i++)
{
<div style="display: inline-block;margin-right:15px">
if(@Model.consolidated_weather[i].applicable_date== DateTime.Now)
{
<div>Today</div>
}
else
{
<div>@Model.consolidated_weather[i].applicable_date.ToString("ddd,dd-MMM")</div>
}