/* Converts the supplied date and time to seconds since the epoch (00h00, 1 Jan 1970).  */
long rtcToEpochTime(int year, int month, int mday, int hour, int min, int sec, int isdst)
/* Converts the supplied date and time to seconds since the epoch (00h00, 1 Jan 1970).  */
long rtcToEpochTime(int year, int month, int mday, int hour, int min, int sec, int isdst)
{
  struct tm t;
  time_t time;
  if (year > 1900) year -= 1900;
  t.tm_year = year;
  t.tm_mon = month;
  t.tm_mday = mday;
  t.tm_hour = hour;     
  t.tm_min = min;
  t.tm_sec = sec;
  t.tm_isdst = isdst;
  time = mktime(&t);
  return (long)time;
}