# 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](../../../../../index.html)

> 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:
* [`__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)`](#__construct)
* [`fromBotAPIFormat(int $offset, int $length, int $date, string $format): \danog\MadelineProto\EventHandler\Message\Entities\FormattedDate`](#fromBotAPIFormat)
* [`getBotAPIFormat(): string`](#getBotAPIFormat)
* [`toBotAPI(): array`](#toBotAPI)
* [`toMTProto(): array`](#toMTProto)
* [`fromRawEntities(list<array> $entities): list<self>`](#fromRawEntities)
* [`fromRawEntity(\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array $entity): \danog\MadelineProto\EventHandler\Message\Entities\MessageEntity`](#fromRawEntity)

## Methods:
### <a name="__construct"></a> `__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`   



### <a name="fromBotAPIFormat"></a> `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`   



### <a name="getBotAPIFormat"></a> `getBotAPIFormat(): string`

Get the bot API date_time_format string.



### <a name="toBotAPI"></a> `toBotAPI(): array`





### <a name="toMTProto"></a> `toMTProto(): array`





### <a name="fromRawEntities"></a> `fromRawEntities(list<array> $entities): list<self>`




Parameters:

* `$entities`: `list<array>`   



### <a name="fromRawEntity"></a> `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](https://phpdoc.daniil.it)
