标签:orm 获取 cond date color javascrip ring eth sda
一、java方式
String leaveTime=""; SimpleDateFormat sDateFormat=new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); Date date=new Date(); leaveTime=sDateFormat.format(date);
二、javascript方式
<script type="text/javascript"> $().ready(function(){ var tDate=new Date(); var year=tDate.getFullYear(); var month=tDate.getMonth()+1; var day=tDate.getDate(); var hour=tDate.getHours(); var minute=tDate.getMinutes(); var second=tDate.getSeconds(); if(month<10){ month="0"+month; } if(day<10){ day="0"+day; } if(hour<10){ hour="0"+hour; } if(minute<10){ minute="0"+minute; } if(second<10){ second="0"+second; } $("#leaveTime").val(year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second); }); </script>
java及javascript两种方式获取YYYY-MM-dd HH:mm:ss格式的日期字符串
标签:orm 获取 cond date color javascrip ring eth sda
原文地址:http://www.cnblogs.com/mr-geng/p/6978779.html