Download this module and add in module directory and enable it.
This module create a service that called by\Drupal::service('persian_date.get_jalali')->getJalali(FORMAT, TIMESTAMP)
Example:
\Drupal::service('persian_date.get_jalali')->getJalali('Y-n-j', 1501572172)
Parameters:
format
Example: 'Y-n-j'
timestamp
Default: time()
tr_num
Default: 'en'
time_zone
Default: 'Asia/Tehran'
Result:
name
Example: Lorem ipsum
image
Example: Source of image