> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinkable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Exports

> Server and client exports available in px_climate

px\_climate exposes a small set of exports for retrieving the current synced environment. These exports are available on both server and client, making it easy to integrate weather and time into any resource.

***

## Export Reference

| Export             | Returns                | Description                                       |
| ------------------ | ---------------------- | ------------------------------------------------- |
| getWeatherType     | string                 | Returns the current GTA weather type.             |
| getLATime          | number, number, number | Returns Los Angeles time as hour, minute, second. |
| getLATimeFormatted | string                 | Returns formatted 12-hour time (e.g. 3:45PM).     |
| getWeatherAndTime  | table                  | Returns combined weather and time data.           |

***

## Usage

Use the exports object from px\_climate to access the current environment state:

```lua theme={null}
local climate = exports.px_climate

local weather = climate:getWeatherType()
local hour, minute, second = climate:getLATime()
local formatted = climate:getLATimeFormatted()

-- Retrieve everything at once
local data = exports.px_climate:getWeatherAndTime()

-- data.weather   -> EXTRASUNNY, RAIN, etc
-- data.hour      -> 0-23
-- data.minute
-- data.second
-- data.formatted -> 12-hour formatted string

-- Returned structure
-- weather = "CLEAR"
-- hour = 14
-- minute = 32
-- second = 10
-- formatted = "2:32PM"

-- Notes
-- All values are synced from the server using GlobalState.
-- Exports always return the latest known state.
-- Safe to call at any time, including during startup fallback.
-- No dependency on client-side state.

-- Events

-- Request
TriggerServerEvent('px_climate:requestWeatherAndTime')

-- Response
RegisterNetEvent('px_climate:responseWeatherAndTime', function(data)
    print(data.weather, data.formatted)
end)
```
