<script type="text/javascript">
function getTime(i)
{
today = new Date();
document.write("现在是:",today.getTime());
today.setTime(i*1000);
document.write("所设时间年份是",today.getYear(),"/",today.getMonth(),"/",today.getDay())
}
</script>
这里面的时间是一个数字类型i*1000是将数据库里面的数字类型转换成时间类型并绑定出来
public static void GetTime(int i)
{
var date = DateTime.Now;
Console.WriteLine("现在是:{0}", (date - new DateTime(1970,1,1)).TotalMilliseconds);
date = new DateTime(1970, 1, 1).AddSeconds(i);
Console.WriteLine("所设时间年份是 {0:yyyy/MM/dd dddd}", date);
}