Как вставить переменную в DateTime и как сделать больше или равно в if - C#
Формулировка задачи:
В общем, есть 2 проблемы, первая. Не могу вставить переменную:
А сама переменная имеет следующую конструкцию:
Вторая проблема, не могу сделать больше или равно в следующей конструкции:
а надо
int s = (int)(DateTime.Now.Subtract(new DateTime(project.Variables["startime"].Value))).TotalSeconds; return s;
return DateTime.Now.ToString("yy, MM, dd, HH, mm, ss");int s = (int)(DateTime.Now.Subtract(new DateTime(project.Variables["startime"].Value))).TotalSeconds;
if ("s" == "1")
{
return "100";
}
return "00";int s = (int)(DateTime.Now.Subtract(new DateTime(project.Variables["startime"].Value))).TotalSeconds;
if ("s" >= "1")
{
return "100";
}
return "00";Решение задачи: «Как вставить переменную в DateTime и как сделать больше или равно в if»
textual
Листинг программы
string format = "yyyy, MM, dd, HH, mm, ss"; DateTime startdate = DateTime.ParseExact(project.Variables["startime"].Value, format, CultureInfo.InvariantCulture); int he = (Int32)(startdate.Subtract(new DateTime(1970, 1, 1, 0, 0, 0 ))).TotalSeconds; return Convert.ToString(he);