The first time the user went online in the format of 2012-07-1809: 07: 56, the time difference in php computing was 12 days. This time is counted from the first time he went online. the time format for his second launch is 2012-07-2506: 11: 56. check if he has expired. check the remaining trial time & nbsp; use p php to calculate the time difference.
The time format for the first user to go online is 09:07:56.
I asked him to try it for 12 days. This time starts from his first launch.
The time format for his second launch was 06:11:56.
Check whether it expires.
Calculate the remaining trial time.
Thanks for implementing it in php. it is unclear about time conversion.
------ Solution --------------------
The initialization is NULL.
The first launch. if it is NULL, it is set to now () timestamp type.
The second launch, if not NULL, takes out the time, using the PHP function time ()-$ item ['TT']> 12*3600
------ Solution --------------------
PHP code
$ D1 = new datetime ('2017-07-18 09:07:56 '); $ d2 = new datetime ('2017-07-25 06:11:56 '); print_r ($ d2-> diff ($ d1 ));