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
Parameter | Description |
---|---|
timestamp | Time in Unix format. Optional parameter, current time is used by default. |
type | Format type. The following values are available:
|
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