| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/sync/notifier/base/time.h" | |
| 6 | |
| 7 #include <string> | |
| 8 #include <time.h> | |
| 9 | |
| 10 #include "chrome/browser/sync/notifier/base/utils.h" | |
| 11 #include "talk/base/common.h" | |
| 12 #include "talk/base/logging.h" | |
| 13 | |
| 14 namespace notifier { | |
| 15 | |
| 16 char* GetLocalTimeAsString() { | |
| 17 time64 long_time = GetCurrent100NSTime(); | |
| 18 struct tm now; | |
| 19 Time64ToTm(long_time, &now); | |
| 20 char* time_string = asctime(&now); | |
| 21 if (time_string) { | |
| 22 int time_len = strlen(time_string); | |
| 23 if (time_len > 0) { | |
| 24 time_string[time_len - 1] = 0; // trim off terminating \n. | |
| 25 } | |
| 26 } | |
| 27 return time_string; | |
| 28 } | |
| 29 | |
| 30 } // namespace notifier | |
| OLD | NEW |