> For the complete documentation index, see [llms.txt](https://pretender.gitbook.io/time-utility-module-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pretender.gitbook.io/time-utility-module-documentation/api.md).

# API

In this section, you will be discover every functions in this module information.

## Functions:

***

{% hint style="warning" %}
The available <mark style="color:red;">time units</mark> are **second**, **minute**, **hour**, **day**, **week**, **month**, **year**, **decade**, **century**, and **millennium**.
{% endhint %}

### GetCurrentDateUnit

Returns the current date unit, including the day of the week, month, day of the month, and year.

**Parameter**

{% hint style="warning" %}
The <mark style="color:red;">GetType</mark> are **"DayOfWeek"**, **"Month"**, **"DayOfMonth"**, **"Year"**, and **"All"**
{% endhint %}

* `GetType`(`string`): The get type to get the date unit(s) of the date.

**Returns**

* `string`: The given date unit that the get type passes into the function.

### FormatSecondToTime

Formats the given number of seconds into a human-readable time format.

{% hint style="warning" %}
The current FormatType right now are "Colons" and "Time\_Units"
{% endhint %}

**Parameters**

* `FormatType (string)`: The format type to format seconds to time.
* `Seconds`(`number`): The number of seconds to format.

**Returns**

* `string`: Formatted time string.

### ConvertTimeUnitToSecond

Converts a time value from the specified unit to seconds.

**Parameters**

* `Time` (`number`): The time value to convert.
* `UnitName` (`string`): The name of the time unit (e.g., "hour", "day", "week").

**Returns**

* `number`: Time value converted to seconds.

### MarkTimeStamp

Marks the current timestamp with the given name for future reference.

**Parameters**

* `TimeMarkName` (`string`): The name of the mark timestamp.

### GetMarkedTimestamp

Retrieves the timestamp associated with the given name.

**Parameters**

* `TimeMarkName` (`string`): The name of the marked timestamp.

**Returns**

* `number`: The timestamp in seconds.

### UpdateMarkedTimestamp

Updates the timestamp with the given name to the current time.

**Parameters**

* `TimeMarkName` (`string`): The name of the marked timestamp to update.

### ViewMarkedTimestamps

Prints out all marked timestamps with their associated names.

### GetElapsedSecondsSinceTimestamp

Calculates the elapsed seconds since the timestamp is marked with the given name.

**Parameters**

* `TimeMarkName` (`string`): The name of the marked timestamp.

**Returns**

* `number`: The elapsed seconds since the timestamp was created by **MarkTimeStamp**.

### UnmarkTimestamp

Removes the marked timestamp with the given name.

**Parameters**

* `TimeMarkName` (`string`): The name of the marked timestamp.
