```php
if ($timestamp)
```
instead
```php
if ($timestamp && $date_format)
```

`$date_format` - always be **TRUE**, because not empty