Documentation

date_helper.php

This file is part of the CodeIgniter 4 framework.

(c) CodeIgniter Foundation admin@codeigniter.com

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Table of Contents

now()  : int
Get "now" time
timezone_select()  : string
Generates a select field of all available timezones

Functions

now()

Get "now" time

now([string $timezone = null ]) : int

Returns time() based on the timezone parameter or on the app_timezone() setting

Parameters
$timezone : string = null
Tags
throws
Exception
Return values
int

timezone_select()

Generates a select field of all available timezones

timezone_select([string $class = '' ][, string $default = '' ][, int $what = DateTimeZone::ALL ][, string $country = null ]) : string

Returns a string with the formatted HTML

Parameters
$class : string = ''

Optional class to apply to the select field

$default : string = ''

Default value for initial selection

$what : int = DateTimeZone::ALL

One of the DateTimeZone class constants (for listIdentifiers)

$country : string = null

A two-letter ISO 3166-1 compatible country code (for listIdentifiers)

Tags
throws
Exception
Return values
string

Search results