I'm trying to get a TimeSpan from "24:30:00" string so I can define cacheOptions in C# but I'm getting 24 days instead of 24 hours.
string cacheExpirationTime = "24:00:00";
var cacheOptions = new MemoryCacheOptions()
{
ExpirationScanFrequency = TimeSpan.Parse(cacheExpirationTime, CultureInfo.InvariantCulture)
};
I also tried without using CultureInfo, but it didn't work.
Which is the proper way to do this?