getFullYear 方法
时间:2007-12-27 来源:不详 作者:林子
返回 Date 对象中用本地时间表示的年份值。
织梦好,好织梦
dateObj.getFullYear()
织梦好,好织梦
必选项 dateObj 参数为 Date 对象。 本文来自织梦
说明
要获取用全球标准时间 (UTC)表示的年份值,请使用 getUTCFullYear 方法。
copyright dedecms
getFullYear 方法以绝对数字的形式返回年份值。例如,1976 年的返回值就是 1976。这样可以避免出现 2000 年问题,从而不会将 2000 年1月1日以后的日期与 1900 年1月1日以后的日期混淆起来。 copyright dedecms
下面这个例子说明了 GetFullYear 方法的用法。
内容来自dedecms
function DateDemo(){ var d, s = "
今天UTC
日期是: ";
d = new Date();
s = (d.getMonth() 1) "/";
s = d.getDate() "/";
s = d.getFullYear();
return(s);
}
织梦好,好织梦

上一篇:getItem 方法 下一篇:getDate 方法
文章评论
共有位Admini5网友发表了评论 查看完整内容