\WP_Stager_Integration\Calendar::calculate_timestamp_year_end(int $year): int

Description

Calculates the end timestamp of a given year (23:59:59 in the current site's timezone, last day of the year).

Parameters:

ParameterTypeDescription
$year int The year

Returns:

int Unix timestamp

Information

Fileclass-calendar.php line 801

Full Code

/**
 * Calculates the end timestamp of a given year (23:59:59 in the current site's timezone, last day of the year).
 *
 * @param int $year     The year
 *
 * @return int   Unix timestamp
 */
public static function calculate_timestamp_year_end( $year ) {

    // Type casting
    $year = (int) $year;

    // Get last day of year timestamp
    return self::calculate_local_timestamp( sprintf( '%d-12-31 23:59:59', $year ) );
}

💡 If you ever get stuck or have a question, please check our FAQs, our Free Integration Service, our paid Full Integration Service, or reach out to us!

Get WP Stager Integration

🎁 Limited offer: Use code WELCOME26 to get your first month for free!