You want to convert between DMYHMSM format (days, months, years, hours, minutes, seconds, milliseconds) and Epoch milliseconds.
getTime( ) and
Most of us are more comfortable thinking of dates and times in terms of components such as hours, days, and years than working with Epoch milliseconds or seconds. For example, it is generally more meaningful to humans to discuss the time and date 3:55 A.M., Friday, October 13, 1978 than to discuss the corresponding Epoch milliseconds value of 277124100000. However, languages such as ActionScript store times in Epoch milliseconds (or Epoch seconds) format. Therefore, it is important to be able to convert between different formats when displaying dates and times to users or when sharing dates between applications that use different formats.
When constructing a date in ActionScript, you can use the DMYHMSM approach, as follows:
// Construct a date for 3:55 AM, Friday, October 13, 1978. myDate = new Date(1978, 9, 13, 3, 55, 0, 0);
ActionScript automatically performs the conversion and stores the
date as the corresponding Epoch milliseconds value. To retrieve that
value, call the
getTime( ) method from the
// For Pacific Standard Time, displays: 277124100000 // The output may vary depending on your time zone. trace(myDate.getTime( ));
You can pass the Epoch seconds value returned by
) to another application (such as ...