26 if (t.
month < 10) outs <<
'0';
27 outs << t.
month <<
'-';
28 if (t.
date < 10) outs <<
'0';
29 outs << t.
date <<
' ';
30 if (t.
hours < 10) outs <<
'0';
31 outs << t.
hours <<
':';
32 if (t.
minutes < 10) outs <<
'0';
34 if (t.
seconds < 10) outs <<
'0';
42 static size_t BUF_MAX = 32;
46 uint16_t value = strtoul(sp, &sp, 10);
48 if (
UNLIKELY(*sp !=
'-'))
return false;
52 value = strtoul(sp + 1, &sp, 10);
53 if (
UNLIKELY(*sp !=
'-'))
return false;
56 value = strtoul(sp + 1, &sp, 10);
57 if (
UNLIKELY(*sp !=
' '))
return false;
60 value = strtoul(sp + 1, &sp, 10);
61 if (
UNLIKELY(*sp !=
':'))
return false;
64 value = strtoul(sp + 1, &sp, 10);
65 if (
UNLIKELY(*sp !=
':'))
return false;
68 value = strtoul(sp + 1, &sp, 10);
69 if (
UNLIKELY(*sp != 0))
return false;
82 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
95 if (dayno < days)
break;
109 if (leap_year && (month == 2)) days++;
110 if (dayno < days)
break;
153 uint16_t dayno =
date - 1;
156 for (uint8_t m = 1; m <
month; m++) {
157 dayno += pgm_read_byte(&
days_in[m]);
158 if (leap_year && (m == 2)) dayno++;
168 const char* compile_date = (
const char *)
PSTR(__DATE__);
169 uint16_t compile_year = 0;
170 for (uint8_t i = 7; i < 11; i++)
171 compile_year = compile_year*10 + (pgm_read_byte(&compile_date[i]) -
'0');
178 this_year.
year = compile_year % 100;
180 uint8_t compile_weekday = this_year.
day;
static const uint8_t days_in[]
const uint16_t Y2K_EPOCH_YEAR
uint8_t minutes
00-59 Minutes.
static uint16_t epoch_year()
static uint8_t pivot_year
uint8_t month
01-12 Month.
static uint16_t days_per(uint16_t year)
const uint8_t Y2K_EPOCH_WEEKDAY
static uint8_t epoch_weekday
const class prog_str * str_P
const uint32_t SECONDS_PER_DAY
const uint8_t SECONDS_PER_MINUTE
char * strcpy_P(char *s1, str_P s2)
uint8_t seconds
00-59 Seconds.
static void use_fastest_epoch()
const uint8_t time_t::days_in[] __PROGMEM
uint8_t hours
00-23 Hours.
static uint8_t epoch_offset
uint16_t full_year() const
IOStream & operator<<(IOStream &outs, const time_t &t)
uint16_t day_of_year() const
static uint8_t weekday_for(uint16_t dayno)
static uint16_t s_epoch_year
const uint16_t SECONDS_PER_HOUR