Drupal日期格式化

ack*_*ack 0 php drupal date drupal-6

代替直接使用php的date()函数,我想触发我创建的日期格式admin/settings/date-time/formats.

乍一看,我以为我能做到这一点:

format_date(strtotime($date), 'customformat');
Run Code Online (Sandbox Code Playgroud)

但看起来format_date()有一些硬编码的格式,并且不与日期/时间格式通信.我可以使用,$type='custom'但这就像php的date()与一些时区逻辑.当然我想在一个地方定义日期格式,并在我的代码中使用这些格式.

goo*_*orp 5

您可以在管理界面中选择短,中,长格式format_date应该是什么样的,但是您无法定义额外的格式,如,mycustomformat.

是什么让format_date比不同的date是,结果是翻译.对于不是英语的网站非常方便.