易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript中日期函数Date详解

对象: 日期
Date是javascript预定义主题. 该主题包括可获取或设置系统日期、时间、月、日、小时、分钟、秒等等。包括函数方法获取 UTC 格式的日期。 UTC 是国际标准时间,也称格林尼治标准时间(Greenwich Mean Time)。
在使用这些方法前可先声明一个主题。
创建新日期主题
示例代码:var exd = new Date();
调用"new Date()" 将创建一个日期主题。该主题可用于调用过程或函数。我们必须在变量中获取该主题。在上述示例代码中该主题存储于变量 exd 中。
以下将使用 exd 作为示例。
方法
示例代码
结果
说明
getDate()
exd = new Date();
exd.getDate();
23 9
getDate() 方法返回您当前系统日期中的天数。 其范围为 1 到 31。
getUTCDate()
exd = new Date();
exd.getUTCDate();
23 9
getUTCDate() 方法返回 UTC 日期中的天数。 UTC 是国际标准时间。
getMonth()
exd = new Date();
exd.getMonth();
3 3
getMonth() 方法返回您系统日期中的月份。 其范围是从 1 到 12. 1 是1月, 12 是12月。
getUTCMonth()
exd = new Date();
exd. getUTCMonth();
3 3
getUTCMonth() 方法返回您系统日期中的 UTC 时间中的月份。
getDay()
exd = new Date();
exd.getDay();
5 5
getDay() 方法返回您系统日期为一周中的星期几。 其返回范围为从 1 到 7. 1 为星期日, 2 是星期一, 到 7 为星期六。
getUTCDay()
exd = new Date();
exd.getUTCDay();
5 5
getUTCDay() 方法返回您系统 UTC 日期是一周中的星期几。
getHours()
exd = new Date();
exd.getHours();
14 20
getHours() 方法返回您系统日期的小时。 该范围是 0 到 24.
getUTCHours()
exd = new Date();
exd.getUTCHours();
6 12
getUTCHours() 方法返回您系统 UTC 日期的小时。 [中国时间比国际标准时间(UTC)快 8 小时].
getMinutes()
exd = new Date();
exd.getMinutes();
2 32
getMinutes() 方法返回您系统日期的分钟。 其结果范围是 0 到 59。
getUTCMinutes()
exd = new Date();
exd. getUTCMinutes();
2 32
getUTCMinutes() 方法返回您系统 UTC 日期的分钟。
getSeconds()
exd = new Date();
exd.getSeconds();
1 30
getSeconds() 方法返回您系统日期的分钟。 其结果范围是 0 到 59。
getUTCSeconds()
exd = new Date();
exd. getUTCSeconds();
1 30
getUTCSeconds() 方法返回您系统 UTC 日期的秒钟。
getMilliseconds()
exd


相关文档:

实用的JavaScript测试及效验工具


JavaScript 是一款强大的广泛运用于现代Web站点及应用的脚本语言。作为一个技艺精湛的 Web 开发者,掌握JavaScript可以增强用户的使用体验,提供交互及富客户端等功能。
尽管JavaScript 的语法非常简单,但对于写程序而言仍然是困难重重,就是因为它的运行环境:基于Web浏览器。
以下您可以看到收集的8个实用的 JavaScr ......

css,javascript的预加载

css,javascript的预加载
为了提高网站的加载速度,有一个很重要的手段就是在用户浏览过程中的上游网站做一个文件的预加载。预加载文件一般有两种常用的方式:xhr和动态插入节点的方式。动态插入节点是最为简单也最为广泛的一种异步加载方式(例如yui的Get模块),然后使用动态插入节点方法加载的文件都会在加载后立即执行, ......

javascript 判断文件类型


function checkfiletype()
{
   var fileName = document.getElementById('<%=FilePath.ClientID%>').value;
   if (Trim(fileName)=="")
        {
            alert("请选择要上传的文件!");
     ......

javascript调用后台的添、删、改、查

前台:
<%@ Page AutoEventWireup="true" CodeBehind="CustomerBizList.aspx.cs" Inherits="SSMIS.UI.MISUI.CustomerBizList"
    Language="C#" MasterPageFile="/Master/WebAdmin.master" %>
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="bcr">
    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号