Create a datetime variable and compare it

Hello,

I need some help please,

I have an indicator,which it create an object on the chart,which in the parameters it has a time value like this: 2017.09.20 12:00

1.I want to save in a variable the current date and time,which it will have value like this too:2017.09.19 17:00

Then i want to compare that too values,this i can do it,i have done that code.

2.Can i compare it without problem that values?

Thanks