### Method

# Malcontent SessionLimits get_active_extension

since: 0.14.0

#### Declaration [src]

    gboolean
    mct_session_limits_get_active_extension (
      MctSessionLimits* limits,
      GDateTime* now_dt,
      uint64_t* out_start_time_secs,
      unsigned int* out_duration_secs
    )

#### Description [src]

Check whether there is an active screen time limit extension, and get its bounds.

If a screen time limit extension has been set on `limits` using `mct_session_limits_builder_set_active_extension()`, and `limits` has at least one limit enabled (see `mct_session_limits_is_enabled()`), and the bounds of the extension contain `now_dt` (i.e. the extension isn’t entirely in the past or the future), then the out arguments will be set to its bounds and true will be returned.

Otherwise, there is no screen time limit extension active, so false will be returned and the out arguments will be set to zero.

Available since: 0.14.0

#### Parameters

`now_dt`

  Type: `GDateTime`

  Current time in the user’s timezone, typically queried using `g_date_time_new_now_local()`.

  The data is owned by the caller of the method.

`out_start_time_secs`

  Type: `uint64_t*`

  Return location for the start time of the extension, in seconds since the Unix epoch; or zero if there is no active extension.

  The argument will be set by the function.
  The argument can be `NULL`.

`out_duration_secs`

  Type: `unsigned int*`

  Return location for the duration of the extension, in seconds; or zero if there is no active extension.

  The argument will be set by the function.
  The argument can be `NULL`.

#### Return value

Type: `gboolean`

True if `limits` has a screen time limit extension active; false otherwise.