Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.timeprovider

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > TimeProvider

TimeProvider class

This is the default implementation of ITimeProvider that simply calls the real browser APIs.

Signature:

export default class TimeProvider implements ITimeProvider

Implements: ITimeProvider

Constructors

Constructor Modifiers Description
(constructor)(serviceScope) Constructs a new instance of the TimeProvider class

Properties

Property Modifiers Type Description
serviceKey static ServiceKey<ITimeProvider> The service key for ITimeProvider.

Methods

Method Modifiers Description
getDate() Returns the current date/time, similar to the Date class constructor.
getTimestamp() Returns a DOMHighResTimeStamp timing measurement, as defined by the standard performance.now() API.
Clone this wiki locally