QA Graphic

Slack Based Greeting

Always know the proper greetings in Slack

Frequently I talk to offshore team members in Slack. The problem that I encounter is that I don't know the time of day its at their location - is it Morning, Afternoon or Night time? So should I say good morning or good evening?

I have a Keyboard Maestro and PHP it makes it real easy to say the proper introduction regardless of where they are in the world.

Real World Example

There is a macro in my library for 'ggi' and this will automatically display the correct greetings when I am talking to my India team in chat. So if it's night time, it would say 'Good Evening' and if it's before 6 pm their time, 'Good Afternoon.' I have similar macros for ggsfo, ggj and ggk .

Now I will always say the correct greetings, I just need to remember where they are located.

This is the PHP code that I use to get that done:
#!/usr/bin/php 
<?php
date_default_timezone_set('Indian/Mauritius');
function greeting(){
    $timeOfDay = date('H');
    if($timeOfDay > '17'){
        return 'Good evening. ';
    } else if ($timeOfDay > '12'){
        return 'Good afternoon. ';
    } else {
        return 'Good morning. ';
    }
}
echo greeting();
?>

You can see the thing that makes the difference is the PHP's date_default_timezone_set function.

This is what the Macro looks like in Keyboard Maestro, your best to use whatever string command works best for you:

India Time Zone

 

Comments

Alain Machado da Silva Dutra Thanks very much, very helpful.

Add Comments

Name:
Comment:

 

About

These posts highlights some cool examples of why Keyboard Maestro should be part of every Mac OS user's computer. Keyboard Maestro is a powerful automation tool that can help improve productivity, save time, and streamline tedious tasks. It has a wide range of features and functions that can be customized to suit any user's needs, making it an ideal choice for Mac OS users.

Schedule

SaturdayInternet Tools
SundayOpen Topic
Monday Media Monday
TuesdayQA
WednesdayKeyboard Maestro
ThursdayGluten Free
FridayMacintosh