Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Time Greeting Re: Time Greeting

#77553
eXo
Member

This works for me:

Code:

<?php
    $cD 
date(“G”);
    if(
$cD <= ’12’){
        echo 
‘Good Morning’;
    }else if(
$cD <= ’18’){
        echo 
‘Good Afternoon’;
    }else{
        echo 
‘Good Evening’;
    }
?>

But like this it will get the current server time. so if the visiter is from another GMT area then it doesn’t work correctly for that visiter.