Skip to content

staff.serverTime ​

2 methods on staff.serverTime. Each returns the answer's data and throws NoviqaError on a failed answer.

retrieve ​

GET/admin/v1/server-time

Get the server clock

The platform clock the trading day, sessions, swaps and daily snapshots follow: offset from UTC, daylight_saving (which calendar moves the clock an hour forward in its season: none, europe [last Sunday of March to last Sunday of October, 01:00 UTC], usa or australia), the minute of the day the trading day rolls over, and the NTP server address the clock syncs against (empty = not configured; the OS owns clock synchronization). server_now is the authoritative current UTC instant. weekly_hours has seven Sunday-to-Saturday 24-bit masks; bit 0 enables 00:00-01:00 in seasonal server time. The default is all hours open; symbol sessions remain additional restrictions. version detects concurrent edits.

More details

Rights: the staff member needs every one of: config.time.

Returns
Promise<serverTimeResponse>
The answer's data.
Errors
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.serverTime.retrieve()
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/server-time" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "day_ends_at_min": 1,
    "daylight_saving": "none",
    "ntp_server": "string",
    "server_now": "2026-09-25T10:15:00Z",
    "utc_offset_min": 1,
    "version": 1,
    "weekly_hours": [
      1
    ]
  },
  "request_id": "5b7f2c1e"
}
ts
staff.serverTime.retrieve(options?: RequestOptions): Promise<http.serverTimeResponse>

update ​

PUT/admin/v1/server-time

Set the server clock

Replaces the clock. utc_offset_min, daylight_saving and day_ends_at_min are required; ntp_server is optional; left out keeps the stored one, empty string clears it. utc_offset_min -720..840, daylight_saving one of none, europe, usa, australia, day_ends_at_min 0-1439, ntp_server at most 253 characters. Unknown fields are refused. A request that changes nothing answers the clock as it is. Send the last-read version to reject stale edits with a conflict. Optional weekly_hours replaces all seven masks (0-16777215 each); omitted preserves them, null is rejected. All-zero masks intentionally close platform trading. The final cutoff minute 1439 means 23:59:59. A repeated DST cutoff uses its later occurrence; a skipped cutoff uses the first instant after the gap. The calendar is platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the trading services pick it up at once.

More details

Rights: the staff member needs every one of: config.time.

Request body
day_ends_at_mininteger
minute of the day the trading day rolls over, 0-1439
daylight_savingDSTRule
DSTRule is which daylight-saving calendar the server clock follows, or none. - europe: last Sunday of March 01:00 UTC to last Sunday of October 01:00 UTC - usa: 2nd Sunday of March 02:00 standard to 1st Sunday of November 02:00 daylight - australia: 1st Sunday of October 02:00 standard to 1st Sunday of April 03:00 daylight
none europe usa australia
ntp_serverstring
host, or host:port (default 123); empty = not synced
utc_offset_mininteger
minutes east of UTC
versioninteger
weekly_hoursinteger[]
Sunday-Saturday, bits 0-23 are open server-clock hours; nil means all open
Returns
Promise<serverTimeResponse>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.serverTime.update({
  day_ends_at_min: 0,
  daylight_saving: "europe",
  ntp_server: "pool.ntp.org",
  utc_offset_min: 120
})
bash
curl -X PUT "$NOVIQA_API_URL/admin/v1/server-time" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "day_ends_at_min": 0,
  "daylight_saving": "europe",
  "ntp_server": "pool.ntp.org",
  "utc_offset_min": 120
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "day_ends_at_min": 1,
    "daylight_saving": "none",
    "ntp_server": "string",
    "server_now": "2026-09-25T10:15:00Z",
    "utc_offset_min": 1,
    "version": 1,
    "weekly_hours": [
      1
    ]
  },
  "request_id": "5b7f2c1e"
}
ts
staff.serverTime.update(body: models.ServerTime, options?: RequestOptions): Promise<http.serverTimeResponse>