| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/notifier/base/time.h" | 5 #include "chrome/common/net/notifier/base/time.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <time.h> | 8 #include <time.h> |
| 9 | 9 |
| 10 #include "chrome/browser/sync/notifier/base/utils.h" | 10 #include "chrome/common/net/notifier/base/utils.h" |
| 11 #include "talk/base/common.h" | 11 #include "talk/base/common.h" |
| 12 #include "talk/base/logging.h" | 12 #include "talk/base/logging.h" |
| 13 | 13 |
| 14 namespace notifier { | 14 namespace notifier { |
| 15 | 15 |
| 16 char* GetLocalTimeAsString() { | 16 char* GetLocalTimeAsString() { |
| 17 time64 long_time = GetCurrent100NSTime(); | 17 time64 long_time = GetCurrent100NSTime(); |
| 18 struct tm now; | 18 struct tm now; |
| 19 Time64ToTm(long_time, &now); | 19 Time64ToTm(long_time, &now); |
| 20 char* time_string = asctime(&now); | 20 char* time_string = asctime(&now); |
| 21 if (time_string) { | 21 if (time_string) { |
| 22 int time_len = strlen(time_string); | 22 int time_len = strlen(time_string); |
| 23 if (time_len > 0) { | 23 if (time_len > 0) { |
| 24 time_string[time_len - 1] = 0; // trim off terminating \n. | 24 time_string[time_len - 1] = 0; // trim off terminating \n. |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 return time_string; | 27 return time_string; |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace notifier | 30 } // namespace notifier |
| OLD | NEW |