Retrieves the current time zone setting of the server.

This function performs an asynchronous request to the server to fetch the time zone configuration. The returned value represents the time zone that the server is using, which can be useful for applications that need to handle or display time-related information accurately according to the server's time zone.

// Retrieve the current server time zone.
const timeZone = await getTimeZone();
console.log(timeZone); // Logs the time zone of the server, e.g., 'America/New_York'

Throws an error if the request fails or if there is an issue with retrieving the time zone.

  • Returns Promise<string>

    A promise that resolves to a string representing the server's current time zone. The time zone is returned in a standard format, such as 'America/New_York' or 'Europe/London'.