Compare two dates in MQL4

 
So here the idea :

I get 2 vars on a CSV file. "date" : 15.01.2013 and var "time" : 18 (ie the January 15, 2013 at 18h).

I can put this format as I want. I wonder if anyone knows a way to know how many times in minutes it rest before that date from the current date?

At least know if it's possible ...

Image explaination


Sorry for my bad English ! Friendly.

 
AFAIK everything is possible in this century
 
jal_fr:
I get 2 vars on a CSV file. "date" : 15.01.2013 and var "time" : 18 (ie the January 15, 2013 at 18h).

I can put this format as I want. I wonder if anyone knows a way to know how many times in minutes it rest before that date from the current date?
  1. format the strings to mql4 format D'1980.07.19 12:30:27'
  2. convert to a datetime
  3. compare to currenttime
datetime csvDT = CsvToDT(csvDateStr, csvTimeStr),
         now   = TimeCurrent();
int      seconds = csvDT - now,
         minutes = seconds/60;
 
WHRoeder:
  1. format the strings to mql4 format D'1980.07.19 12:30:27'
  2. convert to a datetime
  3. compare to currenttime

Exactly, but my problem is to know HOW convert a date like D'1980.07.19 12:30:27' or wathever, to a timestamp ! There is no function that can calculate this automaticaly ?
 

OK, i think a found a solution with this function
https://docs.mql4.com/convert/StrToTime

 
StrToTime will ONLY work if you format the string to mql4 format and you said you already know how to do that.
 
If you can arbitrarily chose the format while creating the csv file (this is how I interpret what you said) then maybe it is possible to format the date as a unix time stamp from the beginning on and never actually use any date strings anywhere. (A timestamp is a simple integer number of seconds) then you can just use it in mql4 as it is (mql4 datetime is also just an ordinary unix timestamp (and the mql4 DateTime type is just an alias for int, its a number you can easily add and subtract).
Reason: