Save as toggle-clock.sh
Right click on toggle-clock.sh.... Properties > permissions and tick execute.
# Script to toggle visibilty of clock in Unity Panel
# Tested in Ubuntu 13.04
hide="gsettings set com.canonical.indicator.datetime show-clock false"
show="gsettings set com.canonical.indicator.datetime show-clock true"
test=$( gsettings get com.canonical.indicator.datetime show-clock )
if [ $test = "true" ]; then
While your there, also right click on toggle-clock.sh and choose copy.
Open keyboard in the dash.
Add a custom shortcut using the path to toggle-clock.sh as the command.
The path should be in your clipboard ready for pasting in the command box.