bonjour,
j'ai réalisé le schéma+ croquis pris dans une revue américaine themometre graphique horodaté
je ne le poste pas ici pour des raisons évidentes de droit d'auteurs
on peut visiter gratuitement la page du projet avec le schéma ICI
par défaut le format est en 12h am/pm, dans le code de 2941 lignes disponible sur github
a la ligne 109 on trouve le choix du format
// TIME-DATE FORMAT PREFERENCES (See also "BuildDayDateTimeText(...) routine for additional explanations)
const uint8_t _12Hr = 0; //Use 12-Hr format. Example: Wed Feb 28 10:47
const uint8_t _Secs = 1; //Include SECONDS in display Example: Wed Feb 30 10:47:23
const uint8_t _YYYY = 2; //Include 4-digit YEAR. Example: Wed Feb 28, 2019 10:47
const uint8_t _AMPM = 4; //Include AM/PM indication. Example: Wed Feb 30 10:47 AM
const uint8_t _24Hr = 8; //Use 24-Hour format. Example: Wed Feb 30 14:47
//Note: _24Hr will over-ride _12Hr and _AMPM flag values
//Set the time format code you want to see by 'summing-up' the various independent flag values
const uint8_t GBL_TimeFormatCode= _12Hr + _AMPM; //Just sum up the format codes you want to see!
je ne vois pas où entrer le bon format dans le croquis avant de téléverser
"Just sum up the format codes you want to see!"
See also "BuildDayDateTimeText(...) routine for additional explanations
j'ai testé : const uint8_t GBL_TimeFormatCode= _24Hr;
çà ne fonctionne pas : l'heure ne passe pas de 12 à 13, mais de 12 à 1 sans le am pm
je sais modifier l'heure avec les boutons mais pas le format
// TIME-DATE FORMAT PREFERENCES (See also "BuildDayDateTimeText(...) routine for additional explanations)
const uint8_t _12Hr = 0; //Use 12-Hr format. Example: Wed Feb 28 10:47
const uint8_t _Secs = 1; //Include SECONDS in display Example: Wed Feb 30 10:47:23
const uint8_t _YYYY = 2; //Include 4-digit YEAR. Example: Wed Feb 28, 2019 10:47
const uint8_t _AMPM = 4; //Include AM/PM indication. Example: Wed Feb 30 10:47 AM
const uint8_t _24Hr = 8; //Use 24-Hour format. Example: Wed Feb 30 14:47
//Note: _24Hr will over-ride _12Hr and _AMPM flag values
//Set the time format code you want to see by 'summing-up' the various independent flag values
const uint8_t GBL_TimeFormatCode= _12Hr + _AMPM; //Just sum up the format codes you want to see!
et
void BuildDayDateTimeText(String &NewDayDateTimeText,uint8_t Format){
// This routine creates a formated text string to show Day Date & Time
// It starts by getting the current date-time from the RTC and then
// make a text string like the following: Sat Feb 26,2019 2:17 PM
//
// PARAMETERS
// String NewDayDateTimeText Text string passed BY REFERENCE
// Short Format Sets the Date-Time format to be generated as follows:
// General Format: Ddd Mmm dd,yyyy hh:mm:ss AM/PM
// 0 = Base, 12 Hour format. Example: "Wed Feb 30 10:47 PM"
// 1 = Include SECONDS
// 2 = Include YEAR (4 Digits)
// 4 = Include AM/PM (Only if applies if a 12 Hr Format selected, otherwise, ignored)
// 8 = 24 Hour Format, Exclude AM/PM. (Note: AM/PM switch is ignored)
// -----
// ADD Add up the above values to arrive at the desired format number
//
// Note: If format is NOT SPECIFIED, display will default to option 0, Example: Sat Feb 26 2:17 PM
Donc pour toi, le second argument de BuildDayDateTimeText doit être 8.
Sinon, cette ligne met le format en 12h AMPM par défaut : const uint8_t GBL_TimeFormatCode= _12Hr + _AMPM; //Just sum up the format codes you want to see!Tu peux la changer en
const uint8_t GBL_TimeFormatCode= _24Hr; //Just sum up the format codes you want to see!