blob: 38a8c0138e33dcc6da0df637fb3f19c07fa6b164 [file] [log] [blame]
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "croslog/test_util.h"
#include <gtest/gtest.h>
namespace croslog {
base::Time TimeFromExploded(int year,
int month,
int day_of_month,
int hour,
int minute,
int second,
int micro_second,
int timezone_offset_hour) {
base::Time time;
base::Time::Exploded{year, month, 0, day_of_month, hour, minute, second,
time += base::TimeDelta::FromMicroseconds(micro_second);
time -= base::TimeDelta::FromHours(timezone_offset_hour);
return time;
} // namespace croslog