New time handling functions - will replace AlarmTime once finished. With tests.