This function would input a datetime, example 2015-02-08-11-05-00, calculate the difference between now ( 2015-02-08-11-38-00 ), which gives here 33 minutes.
Then use a reference time, that will be here chosen as an example 2 hours, to determine the presence time ratio = 33minutes / 2hours, which should be between 0 an 1.
This parameter will be used to make the LED blink.
If it is not clear, please answer this comment as soon as possible
This function would input a datetime, example 2015-02-08-11-05-00, calculate the difference between now ( 2015-02-08-11-38-00 ), which gives here 33 minutes.
Then use a reference time, that will be here chosen as an example 2 hours, to determine the presence time ratio = 33minutes / 2hours, which should be between 0 an 1.
This parameter will be used to make the LED blink. If it is not clear, please answer this comment as soon as possible