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.
Parameter | Description |
---|---|
timestamp | Unix time. Optional; current time is taken by default. |
format_type | Format type. The following values are possible:
|
site_id | The site ID in whose format the datetime is specified. Optional. The current site is used by default. |
<? 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 ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |