SOFT253 Coursework Weather Reader
Fork of Soft253-WeatherReader by
Diff: main.cpp
- Revision:
- 6:0cc980145515
- Parent:
- 5:ba160e9778d0
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;