setutcfullyear(yearvalue[, monthvalue[, dayvalue]])方法的参数如下:
yearvalue - 一个整数,表示年份的数值,例如2008年。monthvalue - 一个介于0和11之间的整数,表示1月到12月的月份。dayvalue - 一个介于1和31之间的整数,表示月份的天数。如果指定了dayvalue参数,还必须指定monthvalue。示例您可以尝试运行以下代码,根据世界协调时间设置指定日期的完整年份:
<html> <head> <title>javascript setutcfullyear method</title> </head> <body> <script> var dt = new date( "aug 28, 2012 23:30:00" ); dt.setutcfullyear( 2018 ); document.write( dt ); </script> </body></html>
以上就是根据世界标准时间,设置指定日期的完整年份的详细内容。
