Skip to content

danog\MadelineProto\EventHandler\Message\Entities\FormattedDate: Message entity representing a date and time, displayed by clients in the local time zone and format of the user.

Back to index

Author: Daniil Gentili daniil@daniil.it

Message entity representing a date and time, displayed by clients in the local time zone and format of the user.

Properties

  • $offset: int Offset of message entity within message (in UTF-16 code units)
  • $length: int Length of message entity within message (in UTF-16 code units)
  • $date: int Unix timestamp of the date
  • $relative: bool Whether to show the date relative to the current time (e.g. “in 5 minutes”), ignoring the other flags
  • $shortTime: bool Whether to show the time in short format (e.g. 22:45)
  • $longTime: bool Whether to show the time in long format (e.g. 22:45:00)
  • $shortDate: bool Whether to show the date in short format (e.g. 17.03.22)
  • $longDate: bool Whether to show the date in long format (e.g. March 17, 2022)
  • $dayOfWeek: bool Whether to show the day of the week

Method list:

Methods:

__construct(int $offset, int $length, int $date, bool $relative = false, bool $shortTime = false, bool $longTime = false, bool $shortDate = false, bool $longDate = false, bool $dayOfWeek = false)

Parameters:

  • $offset: int
  • $length: int
  • $date: int
  • $relative: bool
  • $shortTime: bool
  • $longTime: bool
  • $shortDate: bool
  • $longDate: bool
  • $dayOfWeek: bool

fromBotAPIFormat(int $offset, int $length, int $date, string $format): \danog\MadelineProto\EventHandler\Message\Entities\FormattedDate

Create an entity from a bot API date_time_format string (as accepted by the bot API: r, or a combination of w, d/D and t/T).

Parameters:

  • $offset: int
  • $length: int
  • $date: int
  • $format: string

getBotAPIFormat(): string

Get the bot API date_time_format string.

toBotAPI(): array

toMTProto(): array

fromRawEntities(list<array> $entities): list<self>

Parameters:

  • $entities: list<array>

fromRawEntity(\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array $entity): \danog\MadelineProto\EventHandler\Message\Entities\MessageEntity

Parameters:

  • $entity: \danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array

Generated by danog/phpdoc