2016-02-22 102 views
0

我剛開始HTML和創建這種形式:HTML5的日期和時間格式

<!DOCTYPE html> 
 
<html> 
 
    <head> 
 
    <title> HTML5 Testing Nitesh </title> 
 
    <meta charset ="utf-8"> 
 
    </head> 
 
    <body> 
 
    <form method = "get" action="http://www.msn.com"> 
 
     <p> 
 
     <label> Enter Colour Code </label> 
 
     <input type ="color" autofocus /> 
 
     </p> 
 
     <p> 
 
     <label> Enter The Date </label> 
 
     <input type = "date"/> 
 
     </p> 
 
     <p> 
 
     <label> Enter date with time </label> 
 
     <input type = "datetime" /> 
 
     </p> 
 
     <p> 
 
     <label> Enter local date and time </label> 
 
     <input type = "datetime-local" /> 
 
     </p> 
 
     <br/><br/> 
 
     <input type = "submit" value="Submit"/> 
 
     <input type = "reset" value="Reset"/> 
 
    </form> 
 
    </body> 
 
</html>

現在的問題是我不能正確的日期與時間和當地的日期與時間的輸入值(嘗試谷歌瀏覽器,微軟邊緣和IE),但日期列打開日曆框輸入日期。

回答

-1

請嘗試下面的代碼它可以幫助你。

$('#datetimepicker').datetimepicker({ 
 
    format: 'dd/MM/yyyy hh:mm:ss', 
 
    language: 'pt-BR' 
 
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
 
<script type="text/javascript"src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script> 
 
<script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js"> 
 
    </script> 
 
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> 
 
<link rel="stylesheet" type="text/css" media="screen" href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css"> 
 

 
<div id="datetimepicker" class="input-append date"> 
 
    <input type="text" placeholder="dd/MM/yyyy hh:mm:ss"/> 
 
    <span class="add-on"> 
 
     <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> 
 
    </span> 
 
</div>

+0

這需要的問題了HTML 5 @iqbal的 – user3651808