简体   繁体   English

我如何从Jekyll删除时区?

[英]How do i remove timezone from Jekyll?

Jekyll post.date or site.date seems to automatically have the timezone mentioned, is there any way I could change this? Jekyll post.datesite.date似乎自动提到了时区,有什么方法可以改变这个吗? Or at least change timezone to UTC? 或者至少将时区更改为UTC?

*In Linux Env *在Linux环境中

You can define the timezone in _config.yml like this: 您可以在_config.yml定义时区,如下所示:

timezone: UTC

See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for other values (TZ column) 有关其他值,请参阅https://en.wikipedia.org/wiki/List_of_tz_database_time_zones(TZ列)

Use the Liquid date filter to format the date however you like: 使用Liquid date过滤器根据您的喜好格式化日期:

{{ post.date | date: "%a, %b %d, %y" }}

> >

Mon, Oct 10, 16

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM