Fix casting of datetime in scheduler.
Merge pull request #631 from arjclark/fix-shutdown-datetime

cylc shutdown|stop: fix using a datetime for shutdown