rtc: Add some utility functions