Bug 86396: changed the timestamp format from local time to UTC and include
authorwtc%google.com
Sun, 10 May 2009 04:36:36 +0000
changeset 4113 5ef8599ed2a863ceb85dffa13c2dcf7ed7c1acd2
parent 4112 21798bb42538b510a0eef2e4aeef2b2b6ef69442
child 4114 e44a6f9851246396b425e644dd593152dd3d6938
push idunknown
push userunknown
push dateunknown
bugs86396
Bug 86396: changed the timestamp format from local time to UTC and include a microsecond component. The patch is contributed by Hiroyuki Ikezoe <ikezoe@clear-code.com>. r=wtc.
pr/src/io/prlog.c
--- a/pr/src/io/prlog.c
+++ b/pr/src/io/prlog.c
@@ -448,19 +448,22 @@ PR_IMPLEMENT(void) PR_LogPrint(const cha
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
     if (!logFile) {
         return;
     }
 
     if (outputTimeStamp) {
-        PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &now);
-        nb_tid = PR_FormatTimeUSEnglish(line, sizeof(line)-1,
-                                        "%Y-%m-%d %H:%M:%S - ", &now);
+        PR_ExplodeTime(PR_Now(), PR_GMTParameters, &now);
+        nb_tid = PR_snprintf(line, sizeof(line)-1,
+                             "%04d-%02d-%02d %02d:%02d:%02d.%06d UTC - ",
+                             now.tm_year, now.tm_month, now.tm_mday,
+                             now.tm_hour, now.tm_min, now.tm_sec,
+                             now.tm_usec);
     }
 
     me = PR_GetCurrentThread();
     nb_tid += PR_snprintf(line+nb_tid, sizeof(line)-nb_tid-1, "%ld[%p]: ",
 #if defined(_PR_BTHREADS)
                           me, me);
 #else
                           me ? me->id : 0L, me);