August 1999
Intermediate to advanced
1488 pages
72h 53m
English
date.getUTCFullYear()
The getUTCFullYear() method returns the year as a full four-digit number converted to universal time.
The code in Listing 6.83 displays the year in universal time using the getUTCFullYear() method.
<html>
<script language="JavaScript">
<!-- Hide
//Create a Date object that contains the current date and time.
theDate = new Date();
//Display the full UTC year
document.write("The UTC year is ",theDate.getUTCFullYear());
//Hide End -->
</script>
</html>
|
Read now
Unlock full access