sp core library.timeprovider - microsoft/Viva-Connections-Extensibility-Beta GitHub Wiki

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.
⚠️ **GitHub.com Fallback** ⚠️