CodeIgniter v4.5 API

date_helper.php

This file is part of 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

Functions

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

Functions

now()

Get "now" time

now([non-empty-string|null $timezone = null ]) : int

Returns Time::now()->getTimestamp() based on the timezone parameter or on the app_timezone() setting

Parameters
$timezone : non-empty-string|null = 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

        
On this page

Search results