pb中有没有dd/mm/yy hh:mm:ss的时间日期格式 yy mm dd

SQL中,我查询出来的时间格式是yyyy-mm-dd hh:mm:ss,但是我想要它显示为mm-dd hh:mm,求大神支招。谢谢_百度知道javascript(5)
//比较时间 格式 yyyy-mm-dd hh:mi:ss
window.onload=function() {
var beginTime = ' 00:00:00';
var endTime = ' 00:00:01';
var beginTimes=beginTime.substring(0,10).split('-');
var endTimes=endTime.substring(0,10).split('-');
beginTime=beginTimes[1]+'-'+beginTimes[2]+'-'+beginTimes[0]+' '+beginTime.substring(10,19);
endTime=endTimes[1]+'-'+endTimes[2]+'-'+endTimes[0]+' '+endTime.substring(10,19);
var disparityTime =(Date.parse(endTime)-Date.parse(beginTime))/;
var disparityTime =(Date.parse(endTime)-Date.parse(beginTime))/;
if(disparityTime&0){
alert(&开始时间大&);
}else if (disparityTime&0){
alert(&结束时间大&);
}else if (disparityTime==0){
alert(&相等&);
return &格式不对&;
注:不知何故,firefox对于类似“ 15:55:00”这种时间的转换格式不感冒,返回Nan,查了查资料,把“-”替换为“/”就可以了;
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:32739次
排名:千里之外
原创:16篇
(1)(5)(1)(3)(7)(5)The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.怎么从一个yyyy/mm/dd hh:mm:ss格式的日期里提取到yy/mm/dd这个格式怎么得到?还有判断2个日期格式相等,是用=好吗?如果判断1个日期范围在另一个范围内,是用&好吗?比如:TO_DATE('','yyyy/mm/dd')&Table.time&TO_DATE('','yyyy/mm/dd')select to_char(时间字段名,'yyyy/mm/dd') from tb --这个准确select * from tb where trunc(时间字段名) between '' and '' --这个不准确select * from tb where to_char(时间字段名,'yyyy/mm/dd') between '' and '' --这个准确我这个 4:00:00,已经是日期格式了。另外一个是字符型的,我想用to_date('','yyyy-mm-dd'),转成日期型的和前面的值比较,行吗?日期和时间的正则表达式:时间格式是yyyy-MM-dd hh:mm:ss和MM-dd hh:mm:ss和hh:mm:ss这三种情况都通过,或者这三个的每种格式各写一个表达式
toCF02AQ58
js:var m = /(\d{4}-\d{2}-\d{2}\d{2}:\d{2}:\d{2})|(\d{2}-\d{2}\d{2}:\d{2}:\d{2})|(\d{2}:\d{2}:\d{2})/;
var s = " 21:08:29";
//s = "01-23 21:08:29";
//s = "21:08:29";
alert(m.test(s)); java:将上面的\d换成\\d
MM-dd hh:mm:ss只校验这个格式的呢?
/\d{2}-\d{2}\d{2}:\d{2}:\d{2}/
为您推荐:
其他类似问题
扫描下载二维码

我要回帖

更多关于 yy mm dd hh mm ss 的文章

 

随机推荐