Drupal不使用自定义时间格式类型 [英] Drupal not using custom time format type

查看:198
本文介绍了Drupal不使用自定义时间格式类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用日期和时间下的添加格式类型选项来添加长中和短之外的格式。我的问题是我的格式被忽略,默认为中。

I have used the "Add format type" option under Date and Time to add a format besides Long Medium and Short. My problem is that my format is being ignored and it is defaulting to Medium.

任何想法?

推荐答案

在Drupal 6中,自定义日期格式是date.module的一个功能,因此不与format_date()集成。

In Drupal 6, custom date formats are a feature of date.module and therefore not integrated with format_date().

更改了Drupal 7,现在这是一个核心功能。

This has been changed in Drupal 7, where this is a core feature now.

但是,您可以指定custom作为类型,然后直接传递所需的$格式。您可以编写一个简单的包装器函数,从自定义日期格式获取格式,然后将其传递到format_date()。

However, you can specify 'custom' as type and then pass the desired $format in directly. You could write a simple wrapper function that gets the format from a custom date format and then passes that to format_date().

这篇关于Drupal不使用自定义时间格式类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆