Bitrix Site Manager

ConvertTimeStamp

string
ConvertTimeStamp(
 int timestamp = false,
 string format_type = "SHORT",
 mixed site_id = false
)

The function ConvertTimeStamp converts time from the Unix format to a string in the site format.

Parameters

ParameterDescription
timestamp Unix time.
Optional; current time is taken by default.
format_type Format type. The following values are possible:
  • FULL - full (date and time);
  • SHORT - short (date).
Optional; "SHORT" by default.
site_id The site ID in whose format the datetime is specified.
Optional. The current site is used by default.

See Also

Example



<?
echo "today:                ".ConvertTimeStamp();
echo "yesterday:            ".ConvertTimeStamp(time()-86400);
echo "day before yesterday: ".ConvertTimeStamp(time()-(86400*2));
?>
<?
echo ConvertTimeStamp(mktime(0, 0, 0, 10, 25, 2005), "SHORT", "com"); // 25.10.2005
?>