Moodle中文版日期格式显示问题
  • 提交:天一
  • 时间:08-03-07 21:33
  • 更新:08-03-07 21:33
Moodle中文版日期格式显示问题
Moodle日期显示格式较国际化,常常为日-月-年,欲修改为我们常用的格式可修改moddle数据夹下lang/en_utf8/langconfig.php
首先看看php日期显示格式化的函式strftime():
传回的字符串可以依下列的格式而定:

  • %a 星期几的缩写。
  • %A 星期几的全名。
  • %b 月份名称的缩写。
  • %B 月份名称的全名。
  • %c 本地端日期时间较佳表示字符串。
  • %d 用数字表示本月的第几天 (范围为 00 至 31)。
  • %H 用 24 小时制数字表示小时数 (范围为 00 至 23)。
  • %I 用 12 小时制数字表示小时数 (范围为 01 至 12)。
  • %j 以数字表示当年度的第几天 (范围为 001 至 366)。
  • %m 月份的数字 (范围由 1 至 12)。
  • %M 分钟。
  • %p 以 'AM' 或 'PM' 表示本地端时间。
  • %S 秒数。
  • %U 数字表示为本年度的第几周,第一个星期由第一个周日开始。
  • %W 数字表示为本年度的第几周,第一个星期由第一个周一开始。
  • %w 用数字表示本周的第几天 ( 0 为周日)。
  • %x 不含时间的日期表示法。
  • %X 不含日期的时间表示法。
  • %y 二位数字表示年份 (范围由 00 至 99)。
  • %Y 完整的年份数字表示,即四位数。
  • %Z 时区或名称缩写。
  • %% % 字符。
moodle原始的langconfig.php如下:
$string['alphabet'] = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
$string['backupnameformat'] = '%%Y%%m%%d-%%H%%M';
$string['firstdayofweek'] = '0';
$string['locale'] = 'en_AU.UTF-8';
$string['localewin'] = 'English_Australia.1252';
$string['localewincharset'] = '';
$string['oldcharset'] = 'ISO-8859-1';
$string['strftimedate'] = '%%d %%B %%Y';
$string['strftimedateshort'] = '%%d %%B';
$string['strftimedatetime'] = '%%d %%B %%Y, %%I:%%M %%p';
$string['strftimedaydate'] = '%%A, %%d %%B %%Y';
$string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = '%%A, %%d %%B';
$string['strftimedaytime'] = '%%a, %%H:%%M';
$string['strftimemonthyear'] = '%%B %%Y';
$string['strftimerecent'] = '%%d %%b, %%H:%%M';
$string['strftimerecentfull'] = '%%a, %%d %%b %%Y, %%I:%%M %%p';
$string['strftimetime'] = '%%I:%%M %%p';
$string['thischarset'] = 'UTF-8';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'English';


我们可依我们的需要修改如下:
原来: $string['strftimedate'] = '%%d %%B %%Y';
修改为:$string['strftimedate'] = '%%Y年 %%m月 %%d日';
则日期原为 6 July 2007 --> 2007年 7月 6日

文章推荐

    Loading...

人气排行

    Loading...
[ 简体中文 ] [ 简改蓝 ] 管理模式
Copyright ©2005 - 2008 www.emoodle.org
Processed in 0.009(s) Powered by Hutula 1.0

浙ICP备08007391号-1