如何通过JavaScript将日期格式从dd / mm / yyyy更改为默认格式 [英] How to change date format from dd/mm/yyyy to default format through Javascript
本文介绍了如何通过JavaScript将日期格式从dd / mm / yyyy更改为默认格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
b
$ b
xx = 29/06/2006
$ p
新日期(xx)
$ 2
$ b $ $ $ $ $ $ $> dateFormat(xx,ddd,mmmm dS ,yyyy,h:MM:ss TT)
错误日期,月份,年份结果(星期二,2008年5月6日,中午12点00分)
我在2006年6月29日发表意见,但是在转换之后,它会显示2008年5月6日。
解决方案
check javascript dateFormat
In my Database i am having date in "dd/mm/yyyy" format. In the sucess function I am getting like '29/06/2006". I want to convert this form "dd/mm/yyyy" format to default format (default format means "Thu Jun 29 2006 00:00:00 GMT+0530 (India Standard Time)")
I tried the following ways
1) way
xx = 29/06/2006
new Date(xx)
2)way
dateFormat(xx, "ddd, mmmm dS, yyyy, h:MM:ss TT")
Both giving wrong date,month,year. Result as (Tue, May 6th, 2008, 12:00:00 AM)
I am giving input as Jun 29 2006 but after conversion it'a showing May 6th, 2008.
解决方案
check javascript dateFormat
这篇关于如何通过JavaScript将日期格式从dd / mm / yyyy更改为默认格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文