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
Hi,
I can read the CSV file below in C# when the StartDate property is DateTime. However, I would like StartDate to be DateOnly. I just want the date. When I change DateTime to DateOnly, I get the error: "String '8/3/2022 0:00' contains parts which are not specific to the DateOnly." Can you point me in the right direction? Thank you
StartDate,Description
8/3/2022 0:00,"Buy a pony."
public class Task
{
public DateOnly StartDate { get; set; }
public string Description { get; set; }
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I can read the CSV file below in C# when the StartDate property is DateTime. However, I would like StartDate to be DateOnly. I just want the date. When I change DateTime to DateOnly, I get the error: "String '8/3/2022 0:00' contains parts which are not specific to the DateOnly." Can you point me in the right direction? Thank you
StartDate,Description
8/3/2022 0:00,"Buy a pony."
public class Task
{
public DateOnly StartDate { get; set; }
public string Description { get; set; }
}
Beta Was this translation helpful? Give feedback.
All reactions