Tools.php
public static function getGreeting($time = null)
    {
        if ($time === null) {
            $time = time();
        } elseif (\is_string($time)) {
            $time = strtotime($time);
        }

        switch (date('G', $time)) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
                return self::poorManTranslate('fts-shared', 'Good morning');
            case 8:
            case 9:
            case 10:
            case 11:
                //Underscore to better translate something between morning and noon
                return trim(self::poorManTranslate('fts-shared', '_Good morning'), '_');
            case 12:
                return self::poorManTranslate('fts-shared', 'Good noon');
            case 13:
            case 14:
            case 15:
            case 16:
                return self::poorManTranslate('fts-shared', 'Good afternoon');
            case 17:
            case 18:
            case 19:
                //Underscore to better translate something between noon and evening
                return trim(self::poorManTranslate('fts-shared', '_Good afternoon'), '_');
            case 20:
            case 21:
            case 22:
            case 23:
                return self::poorManTranslate('fts-shared', 'Good evening');
            default:
                return '';
        }
    }
public static function getGreeting($time = null)
    {
        if ($time === null) {
            $time = time();
        } elseif (\is_string($time)) {
            $time = strtotime($time);
        }

        switch (date('G', $time)) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
                return self::poorManTranslate('fts-shared', 'Good morning');
            case 8:
            case 9:
            case 10:
            case 11:
                //Underscore to better translate something between morning and noon
                return trim(self::poorManTranslate('fts-shared', '_Good morning'), '_');
            case 12:
                return self::poorManTranslate('fts-shared', 'Good noon');
            case 13:
            case 14:
            case 15:
            case 16:
                return self::poorManTranslate('fts-shared', 'Good afternoon');
            case 17:
            case 18:
            case 19:
                //Underscore to better translate something between noon and evening
                return trim(self::poorManTranslate('fts-shared', '_Good afternoon'), '_');
            case 20:
            case 21:
            case 22:
            case 23:
                return self::poorManTranslate('fts-shared', 'Good evening');
            default:
                return '';
        }
    }
public static function getGreeting ( $ time = null ) { if ( $ time === null ) { $ time = time ( ) ; } elseif ( \ is_string ( $ time ) ) { $ time = strtotime ( $ time ) ; } switch ( date ( 'G' , $ time ) ) { case 0 : case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : return self :: poorManTranslate ( 'fts-shared' , 'Good morning' ) ; case 8 : case 9 : case 10 : case 11 : //Underscore to better translate something between morning and noon return trim ( self :: poorManTranslate ( 'fts-shared' , '_Good morning' ) , '_' ) ; case 12 : return self :: poorManTranslate ( 'fts-shared' , 'Good noon' ) ; case 13 : case 14 : case 15 : case 16 : return self :: poorManTranslate ( 'fts-shared' , 'Good afternoon' ) ; case 17 : case 18 : case 19 : //Underscore to better translate something between noon and evening return trim ( self :: poorManTranslate ( 'fts-shared' , '_Good afternoon' ) , '_' ) ; case 20 : case 21 : case 22 : case 23 : return self :: poorManTranslate ( 'fts-shared' , 'Good evening' ) ; default : return '' ; } }
Return greeting based on time of the day

@param string|int|null $time Time in string format, timestamp or null for current time

@return string Greeting
@static
Return greeting based on time of the day