# Calendar ## Get Clock `CalendarGetClockResponse v1().calendar().getClock(CalendarGetClockParamsparams = CalendarGetClockParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/v1/clock` Returns the current server time in UTC. ### Parameters - `CalendarGetClockParams params` ### Returns - `class CalendarGetClockResponse:` - `ClockDetail data` Current server time and market clock information - `LocalDateTime clock` Current server time in UTC ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.calendar.CalendarGetClockParams; import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); CalendarGetClockResponse response = client.v1().calendar().getClock(); } } ``` #### Response ```json { "data": { "clock": "2025-03-01T03:35:00.000000000Z" }, "error": null, "metadata": { "request_id": "1b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e" } } ``` ## Get Market Hours Calendar. `CalendarGetMarketHoursCalendarResponse v1().calendar().getMarketHoursCalendar(CalendarGetMarketHoursCalendarParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **get** `/v1/calendars/market-hours` Retrieves comprehensive trading hours including pre-market, regular, and after-hours sessions. Returns market status, session times, and next session schedules. ### Parameters - `CalendarGetMarketHoursCalendarParams params` - `String date` The date to query market hours for (YYYY-MM-DD). Defaults to today. - `Optional market` Market type to query (us_equities, us_options). If omitted, returns all markets. ### Returns - `class CalendarGetMarketHoursCalendarResponse:` - `List data` - `LocalDateTime currentTime` Current time in market timezone with offset - `LocalDate date` The date for which market hours are provided - `MarketType market` Market type identifier - `US_EQUITIES("us_equities")` - `US_OPTIONS("us_options")` - `String marketName` Human-readable market name - `TradingSessions nextSessions` Next trading day's session schedules (without time_until fields) - `Optional afterHours` After-hours session schedule, null if not available - `LocalDateTime close` Session close timestamp with timezone offset - `LocalDateTime open` Session open timestamp with timezone offset - `Optional timeUntilClose` ISO 8601 duration until session closes. Null if session is not currently open. - `Optional timeUntilOpen` ISO 8601 duration until session opens. Null if session has already started or closed. - `Optional preMarket` Pre-market session schedule, null if not available - `Optional regular` Regular trading session schedule, null if holiday/weekend - `MarketStatus status` Market status information - `DayType dayType` The type of trading day - `TRADING_DAY("TRADING_DAY")` - `EARLY_CLOSE("EARLY_CLOSE")` - `HOLIDAY("HOLIDAY")` - `WEEKEND("WEEKEND")` - `boolean isOpen` Whether the market is currently open (real-time) - `Optional currentSession` Current session type if market is open, null if closed - `PRE_MARKET("pre_market")` - `REGULAR("regular")` - `AFTER_HOURS("after_hours")` - `String timezone` IANA timezone identifier for the market - `TradingSessions todaySessions` Trading session schedules for the requested date with time_until fields ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams; import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); CalendarGetMarketHoursCalendarParams params = CalendarGetMarketHoursCalendarParams.builder() .date("date") .build(); CalendarGetMarketHoursCalendarResponse response = client.v1().calendar().getMarketHoursCalendar(params); } } ``` #### Response ```json { "data": [ { "current_time": "2025-11-28T11:00:00-05:00", "date": "2025-11-28", "market": "us_equities", "market_name": "US Equities", "next_sessions": { "after_hours": { "close": "2025-12-01T20:00:00-05:00", "open": "2025-12-01T16:00:00-05:00" }, "pre_market": { "close": "2025-12-01T09:30:00-05:00", "open": "2025-12-01T04:00:00-05:00" }, "regular": { "close": "2025-12-01T16:00:00-05:00", "open": "2025-12-01T09:30:00-05:00" } }, "status": { "current_session": "regular", "day_type": "EARLY_CLOSE", "is_open": true }, "timezone": "America/New_York", "today_sessions": { "pre_market": { "close": "2025-11-28T09:30:00-05:00", "open": "2025-11-28T04:00:00-05:00" }, "regular": { "close": "2025-11-28T13:00:00-05:00", "open": "2025-11-28T09:30:00-05:00", "time_until_close": "PT2H" } } } ], "error": null, "metadata": { "request_id": "3d4e5f6a-7b8c-9d0e-1f2a-3b4c5d6e7f8a" } } ``` ## Domain Types ### Clock Detail - `class ClockDetail:` Current server time and market clock information - `LocalDateTime clock` Current server time in UTC ### Day Type - `enum DayType:` Day type for market hours - indicates the type of trading day - `TRADING_DAY("TRADING_DAY")` - `EARLY_CLOSE("EARLY_CLOSE")` - `HOLIDAY("HOLIDAY")` - `WEEKEND("WEEKEND")` ### Market Hours Detail - `class MarketHoursDetail:` Comprehensive market hours information for a specific market and date - `LocalDateTime currentTime` Current time in market timezone with offset - `LocalDate date` The date for which market hours are provided - `MarketType market` Market type identifier - `US_EQUITIES("us_equities")` - `US_OPTIONS("us_options")` - `String marketName` Human-readable market name - `TradingSessions nextSessions` Next trading day's session schedules (without time_until fields) - `Optional afterHours` After-hours session schedule, null if not available - `LocalDateTime close` Session close timestamp with timezone offset - `LocalDateTime open` Session open timestamp with timezone offset - `Optional timeUntilClose` ISO 8601 duration until session closes. Null if session is not currently open. - `Optional timeUntilOpen` ISO 8601 duration until session opens. Null if session has already started or closed. - `Optional preMarket` Pre-market session schedule, null if not available - `Optional regular` Regular trading session schedule, null if holiday/weekend - `MarketStatus status` Market status information - `DayType dayType` The type of trading day - `TRADING_DAY("TRADING_DAY")` - `EARLY_CLOSE("EARLY_CLOSE")` - `HOLIDAY("HOLIDAY")` - `WEEKEND("WEEKEND")` - `boolean isOpen` Whether the market is currently open (real-time) - `Optional currentSession` Current session type if market is open, null if closed - `PRE_MARKET("pre_market")` - `REGULAR("regular")` - `AFTER_HOURS("after_hours")` - `String timezone` IANA timezone identifier for the market - `TradingSessions todaySessions` Trading session schedules for the requested date with time_until fields ### Market Session Type - `enum MarketSessionType:` Session type for market hours - `PRE_MARKET("pre_market")` - `REGULAR("regular")` - `AFTER_HOURS("after_hours")` ### Market Status - `class MarketStatus:` Market status information - `DayType dayType` The type of trading day - `TRADING_DAY("TRADING_DAY")` - `EARLY_CLOSE("EARLY_CLOSE")` - `HOLIDAY("HOLIDAY")` - `WEEKEND("WEEKEND")` - `boolean isOpen` Whether the market is currently open (real-time) - `Optional currentSession` Current session type if market is open, null if closed - `PRE_MARKET("pre_market")` - `REGULAR("regular")` - `AFTER_HOURS("after_hours")` ### Market Type - `enum MarketType:` Market type for market hours calendar endpoint - `US_EQUITIES("us_equities")` - `US_OPTIONS("us_options")` ### Session Schedule - `class SessionSchedule:` Session schedule with open and close timestamps - `LocalDateTime close` Session close timestamp with timezone offset - `LocalDateTime open` Session open timestamp with timezone offset - `Optional timeUntilClose` ISO 8601 duration until session closes. Null if session is not currently open. - `Optional timeUntilOpen` ISO 8601 duration until session opens. Null if session has already started or closed. ### Trading Sessions - `class TradingSessions:` Trading sessions for a market day with full timestamps - `Optional afterHours` After-hours session schedule, null if not available - `LocalDateTime close` Session close timestamp with timezone offset - `LocalDateTime open` Session open timestamp with timezone offset - `Optional timeUntilClose` ISO 8601 duration until session closes. Null if session is not currently open. - `Optional timeUntilOpen` ISO 8601 duration until session opens. Null if session has already started or closed. - `Optional preMarket` Pre-market session schedule, null if not available - `Optional regular` Regular trading session schedule, null if holiday/weekend