BLE Lightning sensor for Nordic NRF51822 based module
Dependencies: AS3935 AS3935_ext BLE_API mbed nRF51822 nrf51_rtc
Diff: main.cpp
- Revision:
- 6:273ddd00bd90
- Parent:
- 5:b8961da0d06a
- Child:
- 7:7cf0707ae983
--- a/main.cpp Sat Sep 05 05:44:00 2015 +0000 +++ b/main.cpp Sat Sep 05 09:53:52 2015 +0000 @@ -89,7 +89,7 @@ init_timeinfo->tm_year = 70; char date[24]; - strftime(date,sizeof(date),"%H:%M:%S on %m/%d/%G",init_timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S ",init_timeinfo); DEBUG("Initial time set as %s.\r\n",date); // compute the proper value for time in time_t type @@ -106,7 +106,7 @@ struct tm * timeinfo; timeinfo = localtime(&rawtime); char date[24]; - strftime(date,sizeof(date),"%H:%M:%S on %m/%d/%G",timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S ",timeinfo); DEBUG("The current time is %s.(%d)\r\n",date,rawtime); } @@ -172,10 +172,10 @@ time_t rawtime=rtc.time(); struct tm * timeinfo= localtime(&rawtime); - strftime(date,sizeof(date),"%G/%m/%d %H:%M:%S",timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S",timeinfo); DEBUG("Current Time:%d %s\r\n",rawtime,date); - strftime(date,sizeof(date),"%G%m%d%H%M%S",timeinfo); + strftime(date,sizeof(date),"%Y%m%d%H%M%S",timeinfo); BLEC("%s\n",date); } else if ( strncmp("get record ",buff,strlen("get record ")) == 0 ) { @@ -183,7 +183,7 @@ if ( i >= 0 && i < s_evrecord ) { char date[24]; struct tm * timeinfo = localtime(&evrecord[i].time); - strftime(date,sizeof(date),"%G/%m/%d %H:%M:%S",timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S",timeinfo); DEBUG("record %d at %s by %s (%dkm).\r\n",i,date,evrecord[i].events(),evrecord[i].distance); BLEC("r%1d:%08x:%1x:%02x\n",i,evrecord[i].time,evrecord[i].event,evrecord[i].distance); } @@ -199,7 +199,7 @@ init_timeinfo->tm_mon --; char date[24]; - strftime(date,sizeof(date),"%G/%m/%d %H:%M:%S",init_timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S",init_timeinfo); DEBUG("time set is %s.\r\n",date); rawtime = mktime(init_timeinfo); @@ -247,7 +247,7 @@ char date[24];// ,sdate[9]; int distance; - strftime(date,sizeof(date),"%H:%M:%S on %m/%d/%G",timeinfo); + strftime(date,sizeof(date),"%Y/%m/%d %H:%M:%S",timeinfo); // strftime(sdate,sizeof(sdate),"%H%M%S",timeinfo); wait_ms(2); //on attend 2ms préconisation constructeur