Documentation

ConvertTimeStamp

string
ConvertTimeStamp(
 int timestamp = false,
 string type = "SHORT",
 mixed site = false,
 bool SearchInSitesOnly = false
);

The function converts time from the Unix format into the string in the site format.

Function parameters

ParameterDescription
timestamp Time in Unix format.
Optional parameter, current time is used by default.
type Format type. The following values are available:
  • FULL - full (date and time)
  • SHORT - short (date)
Optional parameter, "SHORT" by default.
site Site ID in which format the date must be returned.
Optional parameter, current site is used by default.
SearchInSitesOnly Search only within site.
Optional parameter, false by default, current site.

See Also

Examples of use

<?
echo "Today: ".ConvertTimeStamp();
echo "Yesterday: ".ConvertTimeStamp(time()-86400);
echo "Day before yesterday: ".ConvertTimeStamp(time()-(86400*2));
?>
<?
echo ConvertTimeStamp(mktime(0, 0, 0, 10, 25, 2003), "SHORT", "en"); // 25.10.2003
?>


© «Bitrix24», 2001-2024