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

# Broker server time vs UTC

> Returns the broker server timestamp alongside machine UTC time and the detected UTC offset (broker_time − utc_epoch, rounded to the nearest hour). The bot calls this at startup to auto-detect the broker timezone including DST changes (e.g. RoboForex shows +3 in summer, +2 in winter). Pass `?symbol=BTCUSD` to pin which symbol's tick is used for server time. When the market is closed and no tick is available, `server_epoch` will be `null` and a `warning` field is included.



## OpenAPI

````yaml https://terminal-api.novosky.tech/roboforex/main/openapi.json get /time
openapi: 3.0.3
info:
  description: >-
    Self-hosted HTTP REST API bridging the NOVOSKY trading bot to a MetaTrader 5
    terminal. All bot-to-broker communication goes through this service.
    Authentication is required on all endpoints except `GET /ping`.
  title: MT5 HEADLESS
  version: 1.0.0
servers:
  - url: /
security:
  - bearerAuth: []
tags:
  - description: Health, latency, and error diagnostics
    name: System
  - description: MT5 terminal lifecycle and server time
    name: Terminal
  - description: Broker server time and UTC offset detection
    name: Time
  - description: Live balance, equity, and margin
    name: Account
  - description: Symbol specs, ticks, and OHLCV rates
    name: Symbols
  - description: Open position management
    name: Positions
  - description: Pending order placement and management
    name: Orders
  - description: Closed deals and historical orders
    name: History
paths:
  /time:
    get:
      tags:
        - Time
      summary: Broker server time vs UTC
      description: >-
        Returns the broker server timestamp alongside machine UTC time and the
        detected UTC offset (broker_time − utc_epoch, rounded to the nearest
        hour). The bot calls this at startup to auto-detect the broker timezone
        including DST changes (e.g. RoboForex shows +3 in summer, +2 in winter).
        Pass `?symbol=BTCUSD` to pin which symbol's tick is used for server
        time. When the market is closed and no tick is available, `server_epoch`
        will be `null` and a `warning` field is included.
      operationId: get_broker_time
      parameters:
        - description: Symbol to read tick time from. Uses first available tick if omitted.
          in: query
          name: symbol
          required: false
          schema:
            example: BTCUSD
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeResponse'
          description: Broker time and UTC offset
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid Bearer token
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: MT5 not initialized
components:
  schemas:
    TimeResponse:
      description: >-
        Broker server time vs machine UTC, used to auto-detect the broker
        timezone.
      properties:
        server_epoch:
          description: >-
            Broker server time as Unix epoch. Null when market is closed and no
            tick is available.
          example: 1777879029
          nullable: true
          type: integer
        server_iso:
          example: '2026-05-04T07:17:09+00:00'
          format: date-time
          nullable: true
          type: string
        used_symbol:
          description: Symbol whose tick was used to read server time.
          example: BTCUSD
          nullable: true
          type: string
        utc_epoch:
          description: Current UTC time as Unix epoch.
          example: 1777879028
          type: integer
        utc_iso:
          example: '2026-05-04T07:17:08+00:00'
          format: date-time
          type: string
        utc_offset_hours:
          description: >-
            Detected broker UTC offset rounded to nearest hour. Null when
            server_epoch is null.
          example: 0
          nullable: true
          type: integer
        utc_offset_seconds:
          example: 0
          nullable: true
          type: integer
        warning:
          description: >-
            Present when no tick was available and server time could not be
            read.
          nullable: true
          type: string
      type: object
    ErrorResponse:
      additionalProperties: true
      description: MT5 error payload returned on non-2xx responses.
      properties:
        message:
          example: Invalid stops
          type: string
        retcode:
          description: MT5 error code (e.g. 10014 = invalid stops, 10018 = market closed).
          example: 10014
          type: integer
      type: object
  securitySchemes:
    bearerAuth:
      description: Set `API_TOKEN` in `.env` to match the token configured on the server.
      scheme: bearer
      type: http

````