COZY Documentation
  • Welcome!
    • πŸ‘‹Hello!
    • πŸ—ΊοΈRoadmap
    • πŸ†˜Support & Community
    • πŸŽ“Changelog
  • Getting Started
    • πŸ”ŒInstallation
    • πŸ› οΈSetting Up Your Project
    • 🌐Creating a New Scene
    • πŸ“¦COZY Samples
  • How it works
    • βš™οΈThe System Perspective
    • ⏱️Meridiem Time
    • 🌈Gradients & Curves
    • βš–οΈWeighted Random Chance (WRC)
    • πŸ§‘β€πŸ«Weather Selection & Forecasting
    • The Weather Sphere
      • 🌌The Sky Dome
      • ☁️The Cloud Dome
        • COZY Desktop Clouds
        • COZY Mobile Clouds
        • Soft Clouds
        • Painted Skies
        • Ghibli Desktop & Mobile Clouds
        • Single Texture Clouds
        • Luxury Clouds
      • 🌫️The Fog Dome
    • Modules
      • 🌌Atmosphere Module
      • πŸ•‘Time Module
      • 🌦️Weather Module
      • πŸƒAmbience Module
      • 🌑️Climate Module
      • ⚑Events Module
      • 🎨Interactions Module
      • ☁️Buto Module
      • 🌎MicroSplat Module
      • 🌳The Vegetation Engine (TVE) Module
      • πŸͺžReflections Module
      • πŸŒ™Satellite Module
      • πŸ—ƒοΈSave & Load Module
      • πŸŒ„Transit Module
      • πŸ’¨Wind Module
      • πŸ•‘System Time Module
      • πŸ›Debug Module
      • ☁️Plume Module
      • πŸŒ‡Blocks Module
      • πŸŒ‘Eclipse Module
      • πŸ“†Habits Module
      • 🎼ReSound Module
      • πŸ”—Link Module
    • Profiles
      • Ambience Profile
      • Atmosphere Profile
      • Forecast Profile
      • Perennial Profile
      • Satellite Profile
      • Material Profile
      • Weather Profile
      • FX Profiles
        • Audio FX
        • Climate FX
        • Cloud FX
        • Event FX
        • Filter FX
        • Multi FX
        • Particle FX
        • Precipitation FX
        • Thunder FX
        • Visual FX
        • Wind FX
      • Climate Profile
    • Biomes
    • Settings
  • Extending COZY
    • Stopping Indoor FX
    • Developing the Render Queue
    • Utilities
  • Integrations
    • Crest Water 4 (URP Only)
    • Crest Water 5
    • Stylized Water 2
    • KWS Water System
    • Generic Shader Graph
    • The Vegetation Engine
    • MicroSplat
  • Appendix
    • Frequently Asked Questions (FAQs)
    • Improving Performance With COZY 3
Powered by GitBook
On this page
  • What is Meridiem Time
  • Using Meridiem Time
  • Get the Current Time
  • Convert from Meridiem Time to Float
  • Add Six Hours to a Time
  • Convert to a DateTime struct

Was this helpful?

  1. How it works

Meridiem Time

PreviousThe System PerspectiveNextGradients & Curves

Last updated 7 months ago

Was this helpful?

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.

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 , 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:

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;

Convert from Meridiem Time to Float

//Convert to float
float dayPercentage = (float)weatherSphere.timeModule.currentTime;
//And back to Meridiem Time
float currentTime = (MeridiemTime)dayPercentage;

Add Six Hours to a Time

//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

DateTime newTime = (DateTime)oldTime
⏱️
Time Module