87,997
社区成员




var task = {
run: function(){
Ext.fly('clock').update(new Date().format('g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">
<html>
<head>
<script type="text/javascript" src="ext4/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="ext4/resources/css/ext-all.css"/>
<script type="text/javascript">
Ext.onReady(function(){
var task = {
run: function(){
Ext.fly('clock').update(new Date().format('g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
});
</script>
</head>
<body>
<div id="clock"></div>
</body>
</html>
Ext.onReady(function () {
var task = {
run: function () {
Ext.fly('clock').update(Ext.Date.format(new Date(), 'g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
});
Ext.fly('clock').update(new Date());
// Sample date:
// 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
console.log(Ext.Date.format(dt, 'l, \\t\\he jS \\of F Y h:i:s A')); // Wednesday, the 10th of January 2007 03:05:01 PM