now()

now([$timezone = NULL])

Parameters:
  • $timezone (string) – Timezone
Returns:

UNIX timestamp

Return type:

int

Returns the current time as a UNIX timestamp, referenced either to your server’s local time or any PHP suported timezone, based on the “time reference” setting in your config file. If you do not intend to set your master time reference to any other PHP supported timezone (which you’ll typically do if you run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP’s time() function.

echo now('Australia/Victoria');

If a timezone is not provided, it will return time() based on the time_reference setting.

doc_CodeIgniter
2016-10-15 16:32:31
Comments
Leave a Comment

Please login to continue.