ConvertDateTime
string ConvertDateTime( string datetime, string to_format = FORMAT_DATETIME, mixed from_site = false, bool SearchInSitesOnly = false );
The function takes the date and time specified in the format of the current site and converts it to an arbitrary format.
Function parameters
Parameter | Description |
---|---|
datetime | Date and time in the format of a site passed in site_id. |
to_format | Time format to which the date and time are to be converted. The following designations can be used when specifying the format:
|
from_site | Site ID, which format was used to specify time. Optional parameter, the current site is used by default. |
SearchInSitesOnly | Optional parameter, false by default, current site. |
See Also
Examples of use
<? echo ConvertDateTime("25.12.2003", "YYYY-MM-DD", "ru"); // 2003-12-25 ?>
© «Bitrix24», 2001-2024