|
@@ -300,7 +300,12 @@ void getDateTimeString(char* result)
|
|
|
|
|
|
tmTarget = gmtime(&tbTarget.time);
|
|
|
//sprintf(result, "%04d/%02d/%02d %02d:%02d", tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min);
|
|
|
- sprintf(result, "%04d/%02d/%02d %02d:%02d %s", tmTarget->tm_year+1900,tmTarget->tm_mon+1,tmTarget->tm_mday,(tmTarget->tm_hour%12),tmTarget->tm_min,((tmTarget->tm_hour/12)>0?"p.m":"a.m"));
|
|
|
+ //sprintf(result, "%04d/%02d/%02d %02d:%02d %s", tmTarget->tm_year+1900,tmTarget->tm_mon+1,tmTarget->tm_mday,(tmTarget->tm_hour%12),tmTarget->tm_min,((tmTarget->tm_hour/12)>0?"p.m":"a.m"));
|
|
|
+
|
|
|
+ if((tmTarget->tm_hour%12) == 0)
|
|
|
+ sprintf(result, "%04d/%02d/%02d %02d:%02d %s", tmTarget->tm_year+1900,tmTarget->tm_mon+1,tmTarget->tm_mday,((tmTarget->tm_hour%12)==0?12:(tmTarget->tm_hour%12)),tmTarget->tm_min,((tmTarget->tm_hour/12)==1?"p.m":"a.m"));
|
|
|
+ else
|
|
|
+ sprintf(result, "%04d/%02d/%02d %02d:%02d %s", tmTarget->tm_year+1900,tmTarget->tm_mon+1,tmTarget->tm_mday,(tmTarget->tm_hour%12),tmTarget->tm_min,((tmTarget->tm_hour/12)>0?"p.m":"a.m"));
|
|
|
}
|
|
|
|
|
|
//======================================================
|