fork(4) download
  1. <?php
  2. date_default_timezone_set('Europe/Berlin');
  3.  
  4. $current = strtotime("2015-03-29");
  5. $date = strtotime("2015-03-30");
  6.  
  7. $datediff = $date - $current;
  8. $differance = floor($datediff/(60*60*24));
  9.  
  10. if($differance==0)
  11. {
  12. echo 'today';
  13. }
  14. else if($differance > 1)
  15. {
  16. echo 'Future Date';
  17. }
  18. else if($differance > 0)
  19. {
  20. echo 'tomarrow';
  21. }
  22. else if($differance < -1)
  23. {
  24. echo 'Long Back';
  25. }
  26. else
  27. {
  28. echo 'yesterday';
  29. }
Success #stdin #stdout 0.03s 24400KB
stdin
Standard input is empty
stdout
today