/* This function converts a date in a given time zone to a UNIX timestamp.  */
uint32_t calendar_date_to_timestamp_tz(struct calendar_date *date, int8_t hour, uint8_t min)
/* This function converts a date in a given time zone to a UNIX timestamp.  */
uint32_t calendar_date_to_timestamp_tz(struct calendar_date *date, int8_t hour, uint8_t min)
{
	uint32_t timestamp = calendar_date_to_timestamp(date);
	if (timestamp == 0) {
		return 0;
	} else {
		if (hour >= 0) {
			return (timestamp - (SECS_PER_HOUR * hour + SECS_PER_MINUTE *
					min));
		} else {
			return (timestamp - (SECS_PER_HOUR * hour - SECS_PER_MINUTE *
					min));
		}
	}
}