time_util_win.cc 573 B

12345678910111213141516171819202122
  1. // Copyright 2019 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. #include "rlz/lib/time_util.h"
  5. #include <windows.h>
  6. namespace rlz_lib {
  7. int64_t GetSystemTimeAsInt64() {
  8. FILETIME now_as_file_time;
  9. // Relative to Jan 1, 1601 (UTC).
  10. ::GetSystemTimeAsFileTime(&now_as_file_time);
  11. LARGE_INTEGER integer;
  12. integer.HighPart = now_as_file_time.dwHighDateTime;
  13. integer.LowPart = now_as_file_time.dwLowDateTime;
  14. return integer.QuadPart;
  15. }
  16. } // namespace rlz_lib