Consider using the following code SO answer which is done as per below.

public class DateHelper
{
public static string CalculateExpirationTime(DateTime expiryDate)
{
var currentDate = DateTime.Now;
var dateDifference = (expiryDate - currentDate);
if (dateDifference.Days >= 1)
return $"{ dateDifference.Days } day(s) remained";
else if (dateDifference.Hours >= 1)
return $"{ dateDifference.Hours } hour(s) remained";
else if (dateDifference.Minutes >= 1)
return $"{ dateDifference.Minutes } minute(s) remained";
else if (dateDifference.TotalSeconds >= 1)
return $"{ dateDifference.Seconds } second(s) remained";
return "Expired!";
}
}
Form code where in this case the button code outputs to Visual Studio's output window.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private readonly BindingSource _bindingSource = new BindingSource();
private void Form1_Load(object sender, EventArgs e)
{
var table = new DataTable();
table.Columns.Add("NameColumn", typeof(string));
table.Columns.Add("DateColumn", typeof(DateTime));
table.Columns.Add("ExpireColumn", typeof(string));
table.Rows.Add("Jane", new DateTime(2021,12,1));
table.Rows.Add("Mike", new DateTime(2021,12,10));
table.Rows.Add("Karen", new DateTime(2021,12,23));
table.Rows.Add("Anne", new DateTime(2022,1,1));
for (int rowIndex = 0; rowIndex < table.Rows.Count; rowIndex++)
{
table.Rows[rowIndex].SetField("ExpireColumn",
DateHelper.CalculateExpirationTime(
table.Rows[rowIndex].Field<DateTime>("DateColumn")));
}
_bindingSource.DataSource = table;
dataGridView1.DataSource = _bindingSource;
}
private void IterateButton_Click(object sender, EventArgs e)
{
DataTable table = (DataTable)_bindingSource.DataSource;
for (int rowIndex = 0; rowIndex < table.Rows.Count; rowIndex++)
{
Console.WriteLine(table.Rows[rowIndex]["ExpireColumn"]);
}
}
}