Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Date and Time Functions : idate

idate

Format a local time/date as integer (PHP 5)
int idate ( string format [, int timestamp] )

Example 454. idate() example

<?php
$timestamp
= strtotime('1st January 2004'); //1072915200

// this prints the year in a two digit format
// however, as this would start with a "0", it
// only prints "4"
echo idate('y', $timestamp);
?>

Related Examples ( Source code ) » idate










Code Examples / Notes » idate

qjoe dot sb

To clarify an ambiguity due to the fount: 'I' is a capital i, rather than a miniscule L.

egingell

<?
// idate() for PHP < 5
// Sanity check
if (!is_callable('idate')) {
function idate($char, $ts = false) {
if ($ts === false) {
$ts = time();
} else if (!is_numeric($ts)) {
return false;
}
$char = $char{0};
if ($char == 'B') {
// Swatch time ignores the $ts argument.
return ((int) ((gmdate('U') + 3600) * (1000 / 86400))) % 1000;
} else {
return (int) date($char, $ts); // Drop leading zeroes by casting into an integer.
}
}
}
?>


Change Language


Follow Navioo On Twitter
checkdate
date_create
date_date_set
date_default_timezone_get
date_default_timezone_set
date_format
date_isodate_set
date_modify
date_offset_get
date_parse
date_sun_info
date_sunrise
date_sunset
date_time_set
date_timezone_get
date_timezone_set
date
getdate
gettimeofday
gmdate
gmmktime
gmstrftime
idate
localtime
microtime
mktime
strftime
strptime
strtotime
time
timezone_abbreviations_list
timezone_identifiers_list
timezone_name_from_abbr
timezone_name_get
timezone_offset_get
timezone_open
timezone_transitions_get
eXTReMe Tracker