DateAdd(dateinterval, number, datetime) 对日期或时间作加减。
DateDiff(dateinterval, date1, date2) 计算两个日期或时间间的差值。
DatePart (dateinterval, date) 依接收的日期或时间参数传回年、月、日或时间。
DateSerial(year, month, day) 将接收的参数合并为一个只有日期的Date 型态的数据。
DateValue(datetime) 取得符合国别设定样式的日期值,并包含时间。
Day(datetime) 依接收的日期参数传回日。
DateDiff(dateinterval, date1, date2) 计算两个日期或时间间的差值。
DatePart (dateinterval, date) 依接收的日期或时间参数传回年、月、日或时间。
DateSerial(year, month, day) 将接收的参数合并为一个只有日期的Date 型态的数据。
DateValue(datetime) 取得符合国别设定样式的日期值,并包含时间。
Day(datetime) 依接收的日期参数传回日。
----------------
<script Language="C#" runat="server" >public void Session_Start()
{
Session["Login"]=DateTime.Now;
}</script>DateTime span=Convert.ToDateTime(DateTime.Now-(DateTime)Session["Login"] )