@aws-amplify/core
Version:
Core category of aws-amplify
15 lines (14 loc) • 476 B
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/**
* Returns a `Date` that is corrected for clock skew.
*
* @param systemClockOffset The offset of the system clock in milliseconds.
*
* @returns `Date` representing the current time adjusted by the system clock offset.
*
* @internal
*/
export var getSkewCorrectedDate = function (systemClockOffset) {
return new Date(Date.now() + systemClockOffset);
};