javascript手冊-g

原创 2001年08月27日 19:56:00

getDate method

Returns the day of the month for the specified date.

语法

dateObjectName.getDate()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getDate is an integer between 1 and 31.

例子

The second statement below assigns the value 25 to the variable day, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:00")
day = Xmas95.getDate()

相关

setDate method

getDay method

Returns the day of the week for the specified date.

语法

dateObjectName.getDay()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getDay is an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on.

例子

The second statement below assigns the value 1 to weekday, based on the value of the date object Xmas95. This is because December 25, 1995 is a Monday.

Xmas95 = new Date("December 25, 1995 23:15:00")
weekday = Xmas95.getDay()

getHours method

Returns the hour for the specified date.

语法

dateObjectName.getHours()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getHours is an integer between 0 and 23.

例子

The second statement below assigns the value 23 to the variable hours, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:00")
hours = Xmas95.getHours()

相关

setHours method

getMinutes method

Returns the minutes in the specified date.

语法

dateObjectName.getMinutes()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getMinutes is an integer between 0 and 59.

例子

The second statement below assigns the value 15 to the variable minutes, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:00")
minutes = Xmas95.getMinutes()

相关

setMinutes method

getMonth method

Returns the month in the specified date.

语法

dateObjectName.getMonth()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getMonth is an integer between zero and eleven. Zero corresponds to January, one to February, and so on.

例子

The second statement below assigns the value 11 to the variable month, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:00")
month = Xmas95.getDate()

相关

setMonth method

getSeconds method

Returns the seconds in the current time.

语法

dateObjectName.getSeconds()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getSeconds is an integer between 0 and 59.

例子

The second statement below assigns the value 30 to the variable secs, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:30")
secs = Xmas95.getSeconds()

相关

setSeconds method

getTime method

Returns the numeric value corresponding to the time for the specified date.

语法

dateObjectName.getTime()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00. You can use this method to help assign a date and time to another date object.

例子

The following example assigns the date value of theBigDay to sameAsBigDay.

theBigDay = new Date("July 1, 1999")
sameAsBigDay = new Date()
sameAsBigDay.setTime(theBigDay.getTime())

相关

setTime method

getTimezoneOffset method

Returns the time zone offset in minutes for the current locale.

语法

dateObjectName.getTimezoneOffset()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The time zone offset is the difference between local time and GMT. Daylight savings time prevents this value from being a constant.

例子

x = new Date()
currentTimeZoneOffsetInHours = x.getTimezoneOffset()/60

getYear method

Returns the year in the specified date.

语法

dateObjectName.getYear()

dateObjectName is either the name of a date object or a property of an existing object.

方法

Date

描述

The value returned by getYear is the year less 1900. For example, if the year is 1976, the value returned is 76.

例子

The second statement below assigns the value 95 to the variable year, based on the value of the date object Xmas95.

Xmas95 = new Date("December 25, 1995 23:15:00")
year = Xmas95.getYear()

相关

setYear method

go method

Loads a URL from the history list.

语法

history.go(delta | "location")
delta is an integer or a property of an existing object, representing a relative position in the history list.
location is a string or a property of an existing object, representing all or part of a URL in the history list.

方法

history

描述

The go method navigates to the location in the history list determined by the argument that you specify. You can interactively display the history list by choosing History from the Window menu. Up to 10 items in the history list are also displayed on the Go menu.

The delta argument is a positive or negative integer. If delta is greater than zero, the go method loads the URL that is that number of entries forward in the history list; otherwise, it loads the URL that is that number of entries backward in the history list. If delta is 0, Navigator reloads the current page.

The location argument is a string. Use location to load the nearest history entry whose URL contains location as a substring. The location to URL matching is case-insensitive. Each section of a URL contains different information. See the location object for a 描述 of the URL components.

例子

The following button navigates to the nearest history entry that contains the string "home.netscape.com":

<P><INPUT TYPE="button" VALUE="Go"
   onClick="history.go('home.netscape.com')">

The following button navigates to the URL that is three entries backward in the history list:

<P><INPUT TYPE="button" VALUE="Go"
   onClick="history.go(-3)">

相关

back, forward methods

less参考手册

索引escape(@string); // 通过 URL-encoding 编码字符串 e(@string); // 对字符串转义 %(@string, values...); // 格式化字符串 u...
  • ul646691993
  • ul646691993
  • 2015年05月04日 22:38
  • 670

MB-System帮助手册第一章

第一章 简介 1.1 本手册主要讲什么? MB-SystemTM帮助手册提供了使用MB-SystemTM开源软件包处理条带映射数据的详细例子。每个示例都提供一步一步的指示、解释、代码(脚本),数据...
  • u011115875
  • u011115875
  • 2013年08月13日 16:44
  • 919

linux vi命令手冊

linux下vi命令大全 进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filename :打开文件,并将光标置于第n行首 vi + f...
  • shengshengjia
  • shengshengjia
  • 2016年09月10日 15:51
  • 108

美軍士兵手冊

很適合應用在職場上的生活, 還真是字裡行間都有著令人會心一笑的含意。   美軍士兵手冊-中英雙語對照  1.You are not a superman.  你不是超人.(不要無...
  • hbqhdlc
  • hbqhdlc
  • 2014年05月04日 17:49
  • 1517

手机传感器-G-Sensor

1. 简介 手机传感器介绍手机传感器检测安卓手机上所有可用感应器,并通过图像生动的展示它们是如何运作的。手机传感器也能够识别该手机硬件支持哪些传感器,并提供对我们日常生活起着重要作用的传感工具。手机传...
  • MyArrow
  • MyArrow
  • 2013年06月08日 17:00
  • 11733

js正则标志/g /i /m的用法,以及实例

一,js正则标志/g,/i,/m说明 1,/g 表示该表达式将用来在输入字符串中查找所有可能的匹配,返回的结果可以是多个。如果不加/g最多只会匹配一个 2,/i  表示匹配的时候不区分大小...
  • fygkchina
  • fygkchina
  • 2016年02月24日 16:42
  • 1275

一个新手接触手游项目碰到的bug及解决过程汇总

平台及开发引擎:w7,cocos2dx0.9x版本,基本为框架福州网龙传出来的。 开发项目:一款模仿放三和刀塔等手游的明星题材手游。 bug:在写邮件服务端接口时,由于消息长度在框架中定义为1k,但是...
  • jiangzuzai
  • jiangzuzai
  • 2015年01月30日 11:30
  • 271

JavaScript 游戏开发框架-手游开发js

随着JavaScript结合HTML5开发越来越受欢迎,很多浏览器支持的新功能正被用户使用,与此同时,许多新的游戏正在使用JavaScript进行开发。 基于JavaScript开发的游戏是唯一一个...
  • ejinxian
  • ejinxian
  • 2015年03月24日 19:35
  • 1417

JavaScript 正则一篇入门,不入魂

这里不会对正则的背景进行介绍,将直接对正则的使用进行讲解。注意:有一些文章和书本可能为了让正则表达式看起来不那么密密麻麻,而在正则表达式里加了空格隔开,例如 /(\w+)\s(\w+)/,这个表达式可...
  • vM199zkg3Y7150u5
  • vM199zkg3Y7150u5
  • 2017年12月28日 00:00
  • 80

Arcgis for javascript不同的状态下自定义鼠标样式

首先,说几个状态。1、鼠标在地图上面移动;2、按住鼠标左键拖拽鼠标;3、拉框放大地图;4、拉框缩小地图。 鼠标在地图上面时为 ; 按住鼠标拖拽地图时为 ; 拉框放大地图时为 ; ...
  • u011776918
  • u011776918
  • 2015年06月01日 14:39
  • 1915
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:javascript手冊-g
举报原因:
原因补充:

(最多只允许输入30个字)