OPEnSLab-OSU / Loom

Arduino library for Internet of Things Rapid Prototyping in environmental sensing
GNU General Public License v3.0
26 stars 3 forks source link

Modify timestamp logging to include leading zero #191

Closed kurtjd closed 2 years ago

kurtjd commented 2 years ago

Currently, when timestamps are logged, leading zeros are not included. As an example, if the date is April 3, 2022 and the time is 8:05am, this would get logged as:

date     time
2022/4/3 8:5:0

With this modification, it would now get logged as:

date       time
2022/04/03 08:05:00

Arguably, leading zero's in the date are personal preference, but at least in the time fields, including leading zero's is more natural and human readable.

I made this modification in response to a request from Gurpreet to add a leading zero when one of the time fields is 0 (so 0 becomes 00) but it makes sense to include a leading zero in all cases I think.