var date=new Date(1301356800000);console.log(date.getFullYear()+'-'+date.getMonth()+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds());
//2011-2-29 8:0:0
var date=new Date(2011,2,29,8, 0, 0);
console.log(date.getTime());//1301356800000

解决方案 »

  1.   


     long a =(long) (DateTime.Parse("2011-3-29") - DateTime.Parse("1970-1-1")).TotalMilliseconds;
      

  2.   

    Create a Date Object
    The Date object is used to work with dates and times. Date objects are created with the Date() constructor.There are four ways of initiating a date:new Date() // current date and time
    new Date(milliseconds) //milliseconds since 1970/01/01
    new Date(dateString)
    new Date(year, month, day, hours, minutes, seconds, milliseconds)来自
    JavaScript Date Object
    http://www.w3schools.com/js/js_obj_date.asp
      

  3.   

                    DateTime date = new DateTime(1970, 01, 01);
                    DateTime date2 = date.AddMilliseconds(1301356800000);
                    Response.Write(date + "<br/>");
                    Response.Write((date2 - date).TotalMilliseconds);
                    Response.End();