Beispiel #1
0
uint32_t read_unix_time()
{
	DS1307 time;
	read_ds1307(&time); 
	uint32_t unixtime = time2long(date2days(time.year, time.month, time.day), time.hour, time.minute, time.second);
	return unixtime + SECONDS_FROM_1970_TO_2000;
}
Beispiel #2
0
uint32_t RTC_time_GetUnixtime(void) {
  uint32_t t;
  uint16_t days = days_from_2000(RTC_GetTime (LPC_RTC, RTC_TIMETYPE_YEAR), RTC_GetTime (LPC_RTC, RTC_TIMETYPE_MONTH), RTC_GetTime (LPC_RTC, RTC_TIMETYPE_DAYOFMONTH));
  t = time2long(days, RTC_GetTime (LPC_RTC, RTC_TIMETYPE_HOUR), RTC_GetTime (LPC_RTC, RTC_TIMETYPE_MINUTE), RTC_GetTime (LPC_RTC, RTC_TIMETYPE_SECOND));
  t += SECONDS_FROM_1970_TO_2000; // seconds from 1970 to 2000
  return t;
}
Beispiel #3
0
uint32_t DateTime::unixtime(void) const {
  uint32_t t;
  uint16_t days = date2days(yOff, m, d);
  t = time2long(days, hh, mm, ss);
  t += SECONDS_FROM_1970_TO_2000;  // seconds from 1970 to 2000
  return t;
}
Beispiel #4
0
uint32_t DateTime::unixtime(void) const {
  uint32_t t;
  uint16_t days = date2days(Year, Month, Day);
  t = time2long(days, Hour, Minute, Second);
  t += SECONDS_FROM_1970_TO_2000;  // seconds from 1970 to 2000

  return t;
}
uint32_t DateTime::unixtime(void) const {
  uint32_t t;
  uint16_t days = date2days(year_, month_, day_);
  t = time2long(days, hour_, minute_, second_);
  t += SECONDS_FROM_1970_TO_2000;

  return t;
}
uint32_t DateTime::secondstime( void ) const
{
  uint32_t t;
  uint16_t days = date2days( yOff, m, d );
  
  t = time2long( days, hh, mm, ss );
  return t;
}
Beispiel #7
0
uint32_t DS3231::unixtime(void)
{
    uint32_t u;

    u = time2long(date2days(t.year, t.month, t.day), t.hour, t.minute, t.second);
    u += 946681200;

    return u;
}
Beispiel #8
0
uint32_t DateTime::get() const
{
    return time2long(date2days(yOff, m, d), hh, mm, ss);
}
Beispiel #9
0
uint32_t RTC_time_FindUnixtime(uint16_t year, uint8_t month, uint8_t dayOfM, uint8_t hour, uint8_t min, uint8_t sec) {
  uint16_t days = days_from_2000(year, month, dayOfM);
  uint32_t t = time2long(days, hour, min, sec);
  t += SECONDS_FROM_1970_TO_2000; // seconds from 1970 to 2000
  return t;
}
long DateTime::get()const{
  uint16_t days=date2days(yOff, m ,d);
  return time2long(days, hh, mm, ss);
}
Beispiel #11
0
 uint32_t MTD_FLASHMEM DateTime::getUnixDateTime() const
 {
     uint16_t days = date2days(year, month, day);
     return time2long(days, hours, minutes, seconds) + SECONDS_FROM_1970_TO_2000;
 }