PHP5中的区域设置日期格式 [英] Locale date format in PHP5

查看:75
本文介绍了PHP5中的区域设置日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站根据用户设置或浏览器设置(用户未设置其首选项)更改其区域设置.我正在使用amline图表,特别是股票图表,它要求日期格式为'MM/DD/YYYY'或'DD-MM-YYYY',我想因此图表知道如何理解日期.有多种方法来格式化取决于计算机语言环境的日期,但是我找不到一种获取语言环境格式的方法(如上所述).

my site changes its locale dependent upon either user settings or browser settings (where the user hasn't set their preference). I am using amline charts, the stock chart specifically, which requires the date format in 'MM/DD/YYYY' or 'DD-MM-YYYY', I guess so the chart knows how to understand the dates. There are many ways to format a date dependent upon the computer locale, however I can't find a way to get the locale format (as above).

推荐答案

出了什么问题?

date('m/d/Y')

date('d-m-Y')

这篇关于PHP5中的区域设置日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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