# Preparation
1. Open `core/units/users/users_config.php` for editing and change line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:1', 'default' => '#NOW#'),
```
# Testing `kDateFormatter`
1. Login to `Admin console`
2. Go to {nav User Management > Users}
3. Open some user for editing and change Created On date to 2 years and some days ago
4. Save user
5. Confirm Created On of edited user looks like `2 years ago`
6. Change `core/units/users/users_config.php`, line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:2', 'default' => '#NOW#'),
```
7. Refresh users' list
8. Confirm Created On of edited user looks like `2 years, 6 months ago` (months should correspond to entered value)
9. Change `core/units/users/users_config.php`, line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:3', 'default' => '#NOW#'),
```
10. Refresh users' list
11. Confirm Created On of edited user looks like `2 years, 6 months, 3 weeks ago` (values should correspond to entered value)
12. Change `core/units/users/users_config.php`, line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:4', 'default' => '#NOW#'),
```
13. Refresh users' list
14. Confirm Created On of edited user looks like `2 years, 6 months, 3 weeks, 15 hours ago` (values should correspond to entered value)
15. Change `core/units/users/users_config.php`, line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:5', 'default' => '#NOW#'),
```
16. Refresh users' list
17. Confirm Created On of edited user looks like `2 years, 6 months, 3 weeks, 15 hours, 49 minutes ago` (values should correspond to entered value)
18. Change `core/units/users/users_config.php`, line 370 to:
```
lang=php
'CreatedOn' => Array ('formatter' => 'kDateFormatter', 'format' => 'relative:6', 'default' => '#NOW#'),
```
19. Refresh users' list
20. Confirm Created On of edited user looks like `2 years, 6 months, 3 weeks, 15 hours, 50 minutes, and 20 seconds ago` (values should correspond to entered value)
# Testing `DateHelper::getHumanTime()`
1. Add method into the end of `UsersTagProcessor` class in `core/units/users/users_tag_processor.php`:
``` lang=php, name=core/units/users/users_tag_processor.php
protected function RelatedCreatedOn($params)
{
/** @var kDBItem $object */
$object = $this->getObject($params);
/** @var DateHelper $date_helper */
$date_helper = $this->Application->recallObject('DateHelper');
return $date_helper->getHumanTime(TIMENOW - $object->GetDBField('CreatedOn'), $params['level']);
}
```
2. Add tag into `core/admin_templates/users/users_edit.tpl` just before `<div id="scroll_container">`:
``` lang=html, name=core/admin_templates/users/users_edit.tpl
<inp2:u_RelatedCreatedOn level="1"/><br/>
<inp2:u_RelatedCreatedOn level="2"/><br/>
<inp2:u_RelatedCreatedOn level="3"/><br/>
<inp2:u_RelatedCreatedOn level="4"/><br/>
<inp2:u_RelatedCreatedOn level="5"/><br/>
<inp2:u_RelatedCreatedOn level="6"/><br/>
```
3. Go to {nav User Management > Users}
4. Select previously edited user and click Edit
5. Confirm you see six relative time lines just under header like:
* `2 years ago`
* `2 years, 6 months ago` (months should correspond to entered value)
* `2 years, 6 months, 3 weeks ago` (values should correspond to entered value)
* `2 years, 6 months, 3 weeks, 15 hours ago` (values should correspond to entered value)
* `2 years, 6 months, 3 weeks, 15 hours, 49 minutes ago` (values should correspond to entered value)
* `2 years, 6 months, 3 weeks, 15 hours, 50 minutes, and 20 seconds ago` (values should correspond to entered value)
It should correspond to user's `Created On`.
# Testing `DateHelper::getShortHumanTime()`
1. Add method into the end of `PhraseTagProcessor` class in `core/units/phrases/phrase_tp.php`:
``` lang=php, name=core/units/phrases/phrase_tp.php
protected function RelatedModifiedOn($params)
{
/** @var kDBItem $object */
$object = $this->getObject($params);
/** @var DateHelper $date_helper */
$date_helper = $this->Application->recallObject('DateHelper');
return $date_helper->getShortHumanTime(TIMENOW - $object->GetDBField('LastChanged'));
}
```
2. Add tag into `core/admin_templates/languages/phrase_edit.tpl` just before `<div id="scroll_container">`:
``` lang=html, name=core/admin_templates/languages/phrase_edit.tpl
<inp2:phrases_RelatedModifiedOn/>
```
3. Go to admin console, {nav Website & Content > Labels & Phrases}
4. Select some phrase, note it's `Modified On` time and click Edit
5. Confirm you see relative time like `3d 17h 22mi 43s` just under header. It should correspond to noted `Modified On`