以阿拉伯语显示日期 [英] Display dates in Arabic

查看:407
本文介绍了以阿拉伯语显示日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

setlocale( LC_ALL,'ar' ); 
echo strftime( '%e %b, %Y', strtotime( '2011-10-25' ));

输出:

25 Sep, 2011

为什么不显示阿拉伯日期?我使用strftime的方式不正确吗?

Why is it not displaying the arabic date? Am I using strftime incorrectly?

推荐答案

AFAIK setlocale实际上不会为您进行任何语言翻译,但会影响格式设置和比较器功能.如果您想进行本地化,则可以尝试使用 IntlDateFormatter ,它可能会给您带来帮助您需要什么.

AFAIK setlocale won't actually do any language translation for you but rather affects things like the formatting and comparator functionality. If you want localisation then you could try using IntlDateFormatter which may give you what you need.

已更新:您也可以尝试此问题中所建议,则nofollow noreferrer> Zend_Date 不是您的选择.

Updated: You could also try Zend_Date as suggested in this question if PHP 5.3 isn't an option for you.

这篇关于以阿拉伯语显示日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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