The Date Helper document contains capacities that help with working with dates.
- Stacking this Helper
- Accessible Functions
Stacking this Helper
This aide is stacked utilizing the accompanying code:
The accompanying capacities are accessible:
now([$timezone = NULL])
$timezone (string) – Timezone
Bring type back:
Returns the present time as a UNIX timestamp, referenced either to your server's neighborhood time or any PHP upheld timezone, in view of the "time reference" setting in your config document. On the off chance that you don't expect to set your lord time reference to some other PHP upheld timezone (which you'll normally do on the off chance that you run a site that lets every client set their own timezone settings) there is no advantage to utilizing this capacity over PHP's time() work.
In the event that a timezone isn't given, it will return time() in light of the time_reference setting.
timezone_select([$class = '', $default = '', $what = DateTimeZone::ALL, $country = null])
$class (string) – Optional class to apply to the select field
$default (string) – Default an incentive for starting determination
$what (int) – DateTimeZone class constants (see listIdentifiers)
$country (string) –
A two-letter ISO 3166-1 good nation code (see listIdentifiers)
Preformatted HTML select field
Bring type back:
Creates a select structure field of accessible timezones (alternatively separated by $what and $country). You can supply a choice class to apply to the field to make designing simpler, just as a default chosen esteem.
echo timezone_select('custom-select', 'America/New_York');
Numerous capacities recently found in the CodeIgniter 3 date_helper have been moved to the I18n module in CodeIgniter 4.