now()
now( $timezone = NULL) : integer
Get "now" time
Returns time() based on the timezone parameter or on the "time_reference" setting
Parameters
$timezone |
CodeIgniter
An open source application development framework for PHP
This content is released under the MIT License (MIT)
Copyright (c) 2014 - 2016, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mdate( $datestr = '', $time = '') : integer
Convert MySQL Style Datecodes
This function is identical to PHPs date() function, except that it allows date codes to be formatted using the MySQL style, where each code letter is preceded with a percent sign: %Y %m %d etc...
The benefit of doing dates this way is that you don't have to worry about escaping your text letters that match the date codes.
$datestr | ||
$time |
standard_date(string $fmt = 'DATE_RFC822', integer $time = NULL) : string
Standard Date
Returns a date formatted according to the submitted standard.
As of PHP 5.2, the DateTime extension provides constants that serve for the exact same purpose and are used with date().
string | $fmt | = 'DATE_RFC822' the chosen format |
integer | $time | = NULL Unix timestamp |
** File not found : date(DATE_RFC822, **
** File not found : date(DATE_W3C, **
timespan( $seconds = 1, $time = '', $units = 7) : string
Timespan
Returns a span of seconds in this format: 10 days 14 hours 36 minutes 47 seconds
$seconds | ||
$time | ||
$units |
package |
CodeIgniter |
---|
days_in_month( $month, $year = '') : integer
Number of days in a month
Takes a month/year as input and returns the number of days for the given month/year. Takes leap years into consideration.
$month | ||
$year |
package |
CodeIgniter |
---|
local_to_gmt( $time = '') : integer
Converts a local Unix timestamp to GMT
$time |
package |
CodeIgniter |
---|
gmt_to_local( $time = '', $timezone = 'UTC', $dst = FALSE) : integer
Converts GMT time to a localized value
Takes a Unix timestamp (in GMT) as input, and returns at the local value based on the timezone and DST setting submitted
$time | ||
$timezone | ||
$dst |
package |
CodeIgniter |
---|
mysql_to_unix( $time = '') : integer
Converts a MySQL Timestamp to Unix
$time |
Unix timstamp
package |
CodeIgniter |
---|
unix_to_human( $time = '', $seconds = FALSE, $fmt = 'us') : string
Unix to "Human"
Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM
$time | ||
$seconds | ||
$fmt |
package |
CodeIgniter |
---|
human_to_unix( $datestr = '') : integer
Convert "human" date to GMT
Reverses the above process
$datestr |
package |
CodeIgniter |
---|
nice_date( $bad_date = '', $format = FALSE) : string
Turns many "reasonably-date-like" strings into something that is actually useful. This only works for dates after unix epoch.
$bad_date | ||
$format |
package |
CodeIgniter |
---|
timezone_menu( $default = 'UTC', $class = '', $name = 'timezones', $attributes = '') : string
Timezone Menu
Generates a drop-down menu of timezones.
$default | ||
$class | ||
$name | ||
$attributes |
package |
CodeIgniter |
---|
timezones( $tz = '') : string
Timezones
Returns an array of timezones. This is a helper function for various other ones in this library
$tz |
package |
CodeIgniter |
---|