Bitrix API

DateHelper uses Singleton

Table of Contents

Constants

CLIENT_DATE_FORMAT  = 'D M d Y'
CLIENT_DATETIME_FORMAT  = 'Y-m-d\TH:i:s\Z'
DATE_FORMAT  = 'd.m.Y'
DATETIME_FORMAT  = 'd.m.Y H:i:s'
UTC_TIMEZONE_NAME  = 'UTC'

Methods

__wakeup()  : mixed
getDateUtc()  : DateTime
getInstance()  : static
getOffsetDate()  : DateTime
getServerDate()  : DateTime
isHoliday()  : bool
isNotWorkingDay()  : bool
isWeekend()  : bool

Constants

CLIENT_DATE_FORMAT

public string CLIENT_DATE_FORMAT = 'D M d Y'

CLIENT_DATETIME_FORMAT

public string CLIENT_DATETIME_FORMAT = 'Y-m-d\TH:i:s\Z'

DATETIME_FORMAT

public string DATETIME_FORMAT = 'd.m.Y H:i:s'

UTC_TIMEZONE_NAME

public string UTC_TIMEZONE_NAME = 'UTC'

Methods

getInstance()

public static getInstance() : static
Return values
static

getOffsetDate()

public getOffsetDate(int $userId) : DateTime
Parameters
$userId : int
Tags
throws
ObjectException
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
DateTime

getServerDate()

public getServerDate([string|null $date = null ][, string $format = self::DATE_FORMAT ]) : DateTime
Parameters
$date : string|null = null
$format : string = self::DATE_FORMAT
Return values
DateTime

isHoliday()

public isHoliday(DateTime $dateTime) : bool
Parameters
$dateTime : DateTime
Tags
throws
LoaderException
Return values
bool

isNotWorkingDay()

public isNotWorkingDay(DateTime $dateTime) : bool
Parameters
$dateTime : DateTime
Tags
throws
LoaderException
Return values
bool

isWeekend()

public isWeekend(DateTime $dateTime) : bool
Parameters
$dateTime : DateTime
Tags
throws
LoaderException
Return values
bool

        
On this page

Search results