time.h 697 B

123456789101112131415161718192021222324252627
  1. // Copyright 2012 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. #ifndef COMPONENTS_SYNC_BASE_TIME_H_
  5. #define COMPONENTS_SYNC_BASE_TIME_H_
  6. #include <stdint.h>
  7. #include <string>
  8. #include "base/time/time.h"
  9. namespace syncer {
  10. // Converts a time object to the format used in sync protobufs (ms
  11. // since the Unix epoch).
  12. int64_t TimeToProtoTime(const base::Time& t);
  13. // Converts a time field from sync protobufs to a time object.
  14. base::Time ProtoTimeToTime(int64_t proto_t);
  15. std::string GetTimeDebugString(const base::Time& t);
  16. } // namespace syncer
  17. #endif // COMPONENTS_SYNC_BASE_TIME_H_