Hello,
In my project i save current date. Then i need to check is this saved date is older than current date, i write below code but its not working:
// here i have saved data example: 2017-04-22 10:22:43
var zapisanadatax = project.Variables["fora_creation_date"].Value;
var zapisanadata = System.DateTime.ParseExact(zapisanadatax, "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
int wynik = 11;
if (zapisanadata < System.DateTime.Now) {
wynik = 1;
} else {
wynik = 0;
}
return wynik;
But when i run this code - project show error. Red X.
Can somebody check this code ? System.DateTime.Now is also in this format: yyyy-MM-dd HH:mm:ss
In my project i save current date. Then i need to check is this saved date is older than current date, i write below code but its not working:
// here i have saved data example: 2017-04-22 10:22:43
var zapisanadatax = project.Variables["fora_creation_date"].Value;
var zapisanadata = System.DateTime.ParseExact(zapisanadatax, "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
int wynik = 11;
if (zapisanadata < System.DateTime.Now) {
wynik = 1;
} else {
wynik = 0;
}
return wynik;
But when i run this code - project show error. Red X.
Can somebody check this code ? System.DateTime.Now is also in this format: yyyy-MM-dd HH:mm:ss