洛阳中航光电项目,为12年项目,此处使用反编译工具恢复源码,恢复为.netframe4.0版本,但仍需使用ie8访问; 数据库使用oracle,现再192.168.8.3服务器,访问账户scott,密码800100

time_json_convert.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // * (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2007-07-02 08:09:04.423
  2. //* (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2007-03-10 二 20:09:04
  3. //* (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2007-03-10 周二 08:09:04
  4. //* (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2007-03-10 星期二 08:09:04
  5. //* (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2007-7-2 8:9:4.18
  6. //*/
  7. Date.prototype.format = function (fmt) {
  8. var o = {
  9. "M+": this.getMonth() + 1,
  10. //月份
  11. "d+": this.getDate(),
  12. //日
  13. "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12,
  14. //小时
  15. "H+": this.getHours(),
  16. //小时
  17. "m+": this.getMinutes(),
  18. //分
  19. "s+": this.getSeconds(),
  20. //秒
  21. "q+": Math.floor((this.getMonth() + 3) / 3),
  22. //季度
  23. "S": this.getMilliseconds() //毫秒
  24. };
  25. var week = {
  26. "0": "\u65e5",
  27. "1": "\u4e00",
  28. "2": "\u4e8c",
  29. "3": "\u4e09",
  30. "4": "\u56db",
  31. "5": "\u4e94",
  32. "6": "\u516d"
  33. };
  34. if (/(y+)/.test(fmt)) {
  35. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  36. }
  37. if (/(E+)/.test(fmt)) {
  38. fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "\u661f\u671f" : "\u5468") : "") + week[this.getDay() + ""]);
  39. }
  40. for (var k in o) {
  41. if (new RegExp("(" + k + ")").test(fmt)) {
  42. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  43. }
  44. }
  45. return fmt;
  46. }
  47. //test
  48. // alert(new Date().format("yyyy-MM-dd hh:mm:ss"));