![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SOFT253 Coursework Weather Reader
Fork of Soft253-WeatherReader by
Revision 6:0cc980145515, committed 2017-05-02
- Comitter:
- Jdumpleton3
- Date:
- Tue May 02 11:09:41 2017 +0000
- Parent:
- 5:ba160e9778d0
- Commit message:
- Finish making the time and fix the ctime padding nonsense
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ba160e9778d0 -r 0cc980145515 main.cpp --- a/main.cpp Tue May 02 09:36:46 2017 +0000 +++ b/main.cpp Tue May 02 11:09:41 2017 +0000 @@ -105,7 +105,10 @@ } /* Prints the data that was read */ void printData(){ - printf("%s", ctime(&tempEntry.dt)); + //Location where string is copied when using strftime + char buff[20]; + strftime(buff, 20, "%Y-%m-%d %H:%M:%S", localtime(&tempEntry.dt)); + printf("%s \t", buff); printf("%i: %4.2fC %3.1f%%", headNode, tempEntry.airTemp, tempEntry.airPress); printf(" %6.1f %4.1f\r\n", tempEntry.barPress, tempEntry.barTemp); isNewData = false;