you have to extract specific time units from time_t, and format them for presentation in the format of your choice. the Time library does the extracting for you
sprintf is the optimum way to format data for presentation:
void ShowDateLocal(time_t LocalTime) // LCD 2 MST
{
sprintf(LCDDate, "%04d/%02d/%02d ", year(LocalTime), month(LocalTime), day(LocalTime));
lcd2.setCursor(2,0); lcd2.print(LCDDate); lcd2.print(monthShortStr(month(LocalTime)));
lcd2.setCursor(13,1); lcd2.print(dayShortStr(weekday(LocalTime)));
}
time_t(LocalTime) is time_t(UTC), adjusted for DST & local time zone. the format is YEARMODA
the line that starts with sprintf generates a string that prints the year in DEC 4 digits; a /, the month in DEC padded to 2 digits if necessary, a /, and the day in DEC, padded to 2 digits if necessary
the d on %04d makes it display DECimal, 04 makes the year display 4 digits, the 0 in 04 makes it add 0s to the left to pad out shorter numbers, the end product of that line:
2019/05/09
you would want dashes: - where I used slashes: /
this, and the time display routine, require a variable declaration above void setup:
// LCD Displays
char LCDTime[] = "00000000"; // used by sprintf to format time displays
char LCDDate[] = "0000000000"; // used by sprintf to format date displays
much better than many lines of "if hour <10 then add a zero to the front..."
the same function, for UTC time:
void ShowTimeUTC(time_t t) // LCD 1 UTC
{
sprintf(LCDTime, "%02d:%02d:%02d", hour(t), minute(t), second(t));
lcd1.setCursor(0,1); lcd1.print(LCDTime); lcd1.print(" UTC");
}