Documentation

GetDateFormat

string
CSite::GetDateFormat(
  string type = "FULL",
  mixed lang = false,
  bool SearchInSitesOnly=false
)

The method returns the site date (time) format. Static method.

Parameters

Parameter Description
type Format type. The following values are available:
  • FULL - for both date and time
  • SHORT - date only
Optional parameter. "FULL" by default.
lang Site ID.
Optional parameter. The current site ID is used by default.
SearchInSitesOnly Optional parameter. If the variable is set as true, the administrative section will use the site default language instead of the language, specified for the administrative section.

See Also

Examples of use

<?
// displays the current date in the format of the current site 
echo date($DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")), time());
?>


© «Bitrix24», 2001-2022
Up