SimApi Timer seekToTime 2

From SIMboxWiki
Jump to navigation Jump to search

Icon attributes.pngstatic void SimApi::Timer::seekToTime(const _SYSTEMTIME &i_Time)


    Seeks to time using SYSTEMTIME structure - sets a new simulation time from mission start


    i_Time - The new simulation time in SYSTEMTIME structure. The SYSTEMTIME value should be between start and end time of the mission.


The common used of this function is in playback mode, where a plugin can "jump" to a specific time in the session based on a user action or other logic. SeekToTime will publish a "TimeChanged" event with the new time values. For details about SYSTEMTIME structure see its information in MSDN. You can use overloaded function for seeking by seconds from mission start.

    Code Sample


// Set time to Thursday, 3 Dec 2009, 10:45:00:000
st.wYear         = 2009;
st.wMonth        = 12;   // December
st.wDayOfWeek    = 4;    // Thursday
st.wDay          = 3;
st.wHour         = 10;   // 10 AM
st.wMinute       = 45;
st.wSecond       = 0;
st.wMilliseconds = 0;

// Seek to that time within the session

    See Also


    Related Links

    [[ | ]]

     Recommended: Simulation Time Overview