Previous Page
Next Page

14.0. Introduction

Dates and times are important to many ActionScript applications, particularly when more robust applications are developed to offer services to users. For example, date and time values are important for determining the amount of time that has elapsed for timed operations, for determining whether a user's trial membership is active or about to expire, and for storing transaction dates.

ActionScript stores dates and times internally as epoch milliseconds, the number of milliseconds that have elapsed since the Epochmidnight, January 1, 1970 Coordinated Universal Time (UTC). For our purposes, UTC is essentially equivalent to the more familiar Greenwich Mean Time (GMT). See the U.S. Naval Observatory's site (http://aa.usno.navy.mil/faq/docs/UT.html) regarding the subtle distinctions. Many programming languages store dates in terms of the epoch (often in seconds instead of milliseconds); therefore, you can readily work with date and time values that have been imported from other sources (and vice versa).

In addition, the Date class allows you to set and get date and time values in terms of years, months, days, and so on by using properties such as fullYear, month, etc. These properties are for your convenience, but the values are stored internally as epoch milliseconds.


Previous Page
Next Page
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)