现在的位置: 首页 > 综合 > 正文

纯属恶搞–javascript的 c#用法

2012年11月17日 ⁄ 综合 ⁄ 共 659字 ⁄ 字号 评论关闭
  //--基类 
   function _System()
   
{
   
   }

   
//基类包含的三种数据流类型 
     _System.int=0;
     _System.bool
=false;
     _System.string
="";
     _System.
char='';
//封装时间函数
 _System.prototype.DateTime=function()
   
{
    
return new Date;
   }

//--欧也~~时间函数+一个静态方法,得到当前的日期
    _System.prototype.DateTime.Now=function()
    
{
     
var today=new Date;
      
return today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate()+" "+today.getHours()+":"+today.getMinutes()+":"+today.getSeconds();
    
    }

   
//返回日期部分其他的是0
  _System.prototype.DateTime.Now.Date=function()
    
{
     
var today=new Date;
      
return today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate()+" 00:00:00";
    
    }

抱歉!评论已关闭.