# Meridiem Time

## What is Meridiem Time

Meridiem Time is the time method of choice for COZY: Weather. At its core, Meridiem Time transforms your world time to a variety of other structures and data types so that it can be easily refenced by any number of systems.

Meridiem Time is a struct that contains an int field for hours (0-23) and minutes (0-59). These values are parsed and saved as a float value (0-1) which can be manipulated on the backend or reconverted back into Meridiem Time for easy viewing on the frontend.&#x20;

## Using Meridiem Time

Meridiem Time is a completely original structure for time management, but it is incredibly simple to use in a variety of cases.

### Get the Current Time

Using the [Time Module](modules/time-module), you can easily get the current time and reference it in your game. This code block will grab the current time from the Time Module:

{% code fullWidth="false" %}
```csharp
using DistantLands.Cozy

//Cache the reference to CozyWeather.instance as weatherSphere
//Get the current hour (24 hour scale)
weatherSphere.timeModule.currentTime.hours;
//Get the current minute (60 minute scale)
weatherSphere.timeModule.currentTime.minutes;
```
{% endcode %}

### Convert from Meridiem Time to Float

<pre class="language-csharp"><code class="lang-csharp">//Convert to float
<strong>float dayPercentage = (float)weatherSphere.timeModule.currentTime;
</strong>//And back to Meridiem Time
float currentTime = (MeridiemTime)dayPercentage;
</code></pre>

### Add Six Hours to a Time

```csharp
//Meridiem Time can be added, subtracted, and verified without transforming its data type.
MeridiemTime newTime = oldTime + new MeridiemTime(6, 0);
```

### Convert to a DateTime struct

```csharp
DateTime newTime = (DateTime)oldTime
```
