Until now my sketch has stored datetime for display on a screen in a character array like so;
char serverdatetime[16];
27 Jan 7:40 pm
Yes I know it's a horrible waste of SRAM!
Apart from wanting to store datetime properly, my sketch will eventually need to know what day of the week it is.
I don't need the sketch to keep time itself, and I'm not using a RTC. Instead the Arduino is receiving a datetime message from the server every 30 seconds, in exactly the format above, so I'm just copying the string into a char array right now. (Obviously millisecond accuracy is not critical to this application.)
I'm aware of the Arduino DateTime library, but given I don't need the sketch to keep its own time, would it be more memory efficient to store the date and time in my own struct, then make some basic calculations to work out what day of the week it is (i.e. 1=Monday)?
Or should I just use the DateTime library and update the value every time the MQTT message is received?