ÔÑÍ ßíÝíÉ Úãá æ ÖÈØ ÇáÊÇÑíÎ æ ÇáÓÇÚÉ Ýì ÓãÇÑÊí Smarty Date and Time zone
ÔÑÍ Úãá ÇáÓÇÚÉ æ ÇáÊÇÑíÎ ÇáÇä , ÔÑÍ Úãá ÇáÓÇÚÉ ÇáÇä ØÈÞÇ ááãäØÞÉ Timezone
ÔÑÍ ßæÏ ÓãÇÑÊì áÚãá ÓÇÚÉ æ ÊÇÑíÎ ãÍÏÏÉ ãÚ ÇáÑãæÒ

Designers can then use date_format to have complete control of the formatting of the date. If the date passed to date_format is empty and a second parameter is passed, that will be used as the date to format.



{$smarty.now}

{$smarty.now}The current timestamp can be accessed with {$smarty.now}. The value reflects the number of seconds passed since the so-called Epoch on January 1, 1970, and can be passed directly to the date_format modifier for display. Note that time() is called on each invocation; eg a script that takes three seconds to execute with a call to $smarty.now at start and end will show the three second difference.

{* use the date_format modifier to show current date and time *}
{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}

*************************************************
ãËÇá: ãØáæÈ Úãá ÇáÔßá ÇáÊÇáì ÈäÙÇã ÓãÇÑÊì
*************************************************

Jan 1, 2022
01/01/22
02:33 pm
Dec 31, 2021
Monday, December 1, 2021
14:33:00
###############################
ÇáÎØæÇÊ :
###############################

1- ÇáßæÏ ÏÇÎá PHP :


ßæÏ:
<?php

$config['date'] = '%I:%M %p';
$config['time'] = '%H:%M:%S';
$smarty->assign('config', $config);
$smarty->assign('yesterday', strtotime('-1 day'));

?>
2- ÇáßæÏ ÏÇÎá TPL :


ßæÏ:
{$smarty.now|date_format}
{$smarty.now|date_format:"%D"}
{$smarty.now|date_format:$config.date}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:$config.time}
###############################
ãÏáæáÇÊ ÇáÑãæÒ :
###############################



ÊÍÏíÏ Timezone Ýì Smarty

íÊã æÖÚ ÇáÑãÒ " z% " Ýì ßæÏ TPL ãæÖÚ ÇáãäØÞÉ Ýì Php

ßæÏ:
ini_set('date.timezone', 'Egypt');
ÇáãÑÌÚ :
https://www.smarty.net/docsv2/en/lan...ate.format.tpl
https://www.smarty.net/docsv2/en/lan...les.smarty.now