Skip to content

Simulation Clock

Read simulator time and set the clock to an offset, time of day, or named solar moment.

Updated View as Markdown
For humans
Flow APIFlow Pro scriptingSimulator data

This article covers the following platforms

Use the Time API to inspect simulator time and move the simulation clock to a specific offset, time of day, or named solar moment.

get_sun_position()

Get the sun position and relevant times of day.

SignatureTypeScript contract
get_sun_position(): Record<string, unknown>
ExampleJavaScript
const sun = this.$api.time.get_sun_position();
console.log(sun);

Returns

Record<string, unknown>Object containing the sun position and relevant times of day.

get_sim_time_utc()

Get the simulator’s current UTC time.

SignatureTypeScript contract
get_sim_time_utc(): Date
ExampleJavaScript
const utcTime = this.$api.time.get_sim_time_utc();
console.log(utcTime);

Returns

DateSimulator time in UTC.

get_sim_time_local()

Get the simulator’s current local time.

SignatureTypeScript contract
get_sim_time_local(): Date
ExampleJavaScript
const localTime = this.$api.time.get_sim_time_local();
console.log(localTime);

Returns

DateSimulator time in the local time zone.

set_sun_offset_utc()

Offset the simulator time from its current UTC value.

SignatureTypeScript contract
set_sun_offset_utc(offset: number): void

Parameters

NameTypeRequiredDescription
offsetnumberYesTime offset in seconds.
ExampleJavaScript
this.$api.time.set_sun_offset_utc(3600);

Returns

voidNo direct return value is documented.

set_local_time()

Set the local time of day.

SignatureTypeScript contract
set_local_time(local_time_of_day: number): void

Parameters

NameTypeRequiredDescription
local_time_of_daynumberYesNumber of seconds since local midnight.
ExampleJavaScript
this.$api.time.set_local_time(14 * 60 * 60);

Returns

voidNo direct return value is documented.

set_zulu_time()

Set the Zulu time of day.

SignatureTypeScript contract
set_zulu_time(zulu_time_of_day: number): void

Parameters

NameTypeRequiredDescription
zulu_time_of_daynumberYesNumber of seconds since midnight in Zulu time.
ExampleJavaScript
this.$api.time.set_zulu_time(18 * 60 * 60);

Returns

voidNo direct return value is documented.

set_time_by_moment()

Set simulator time using a supported named solar moment.

SignatureTypeScript contract
set_time_by_moment(moment: string): void

Parameters

NameTypeRequiredDescription
momentstringYesOne of the supported moment values listed below.
ExampleJavaScript
this.$api.time.set_time_by_moment("goldenHourDawnStart");

Returns

voidNo direct return value is documented.

Supported moment values

Value Behavior
live Real time
solarNoon Solar noon, when the sun is highest
nadir Darkest moment of night, when the sun is lowest
goldenHourDawnStart Start of the morning golden hour
goldenHourDawnEnd End of the morning golden hour
goldenHourDuskStart Start of the evening golden hour
goldenHourDuskEnd End of the evening golden hour
sunriseStart Top edge of the sun appears on the horizon
sunriseEnd Bottom edge of the sun reaches the horizon
sunsetStart Bottom edge of the sun reaches the horizon
sunsetEnd Sun disappears below the horizon
blueHourDawnStart Start of the morning blue hour
blueHourDawnEnd End of the morning blue hour
blueHourDuskStart Start of the evening blue hour
blueHourDuskEnd End of the evening blue hour
civilDawn Morning nautical twilight ends and civil twilight starts
civilDusk Evening nautical twilight starts
nauticalDawn Morning nautical twilight starts
nauticalDusk Evening astronomical twilight starts
amateurDawn Sun reaches 12° below the horizon before sunrise
amateurDusk Sun reaches 12° below the horizon after sunset
astronomicalDawn Night ends and morning astronomical twilight starts
astronomicalDusk Night starts
Navigation

Type to search…

↑↓ navigate↵ selectEsc close