Format menu bar time to english words
I saw this screenshot of someone's menu bar and their time formatting is set in readable English.
Is this a this party app or a setting / script I can run on OS X?
I wrote a script to do this.
To show it in the menubar, use BitBar. A small app which creates menubar items from shell script output.
Once you download BitBar, save the following code into a file called lingualtime.1s.php
then point BitBar to where you saved it.
#!/usr/bin/env php
<?php
# <bitbar.title>Lingual Clock</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Stan Hutcheon</bitbar.author>
# <bitbar.author.github>stnvh</bitbar.author.github>
# <bitbar.desc>displays the current time in a sentence</bitbar.desc>
# <bitbar.dependencies>php</bitbar.dependencies>
$time = array_map(function($time) {
return intval($time);
}, explode(' ', date('g i')));
$st = array('hour' => '', 'minute' => '');
$past = '%s past %s'; $to = '%s to %s';
$pastHalf = false;
function get($int) {
$numbers = array(
1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine',
11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen',
10 => 'ten', 20 => 'twenty', 30 => 'thirty', 40 => 'fourty', 50 => 'fifty'
);
return isset($numbers[$int]) ? $numbers[$int] : '';
}
if($time[1] >= 35) {
$pastHalf = true;
$time[0] = $time[0] === 12 ? 1 : ++$time[0];
$time[1] = 60 - $time[1];
}
# get lingual values
foreach(array('hour', 'minute') as $key => $part) {
if($time[$key] < 20) {
$st[$part] = get($time[$key]);
} else {
$currTenth = floor($time[$key] / 10) * 10;
$currRem = $time[$key] - $currTenth;
$ling = get($currTenth);
if($ext = get($currRem)) {
$ling .= '-' . $ext;
}
$st[$part] = $ling;
}
}
printf(($pastHalf ? $to : $past) . PHP_EOL, $st['minute'], $st['hour']);
I believe the app that you're looking for is called World Time. It's a paid app ($1.99 USD) and should do everything that you want it to do. I don't know any free alternatives, though.