Date and Time

The Date class is built-in to Flash. An instance of the Date is automatically initialized with the current date and time. The class has methods for retrieving the day, month, year, hours, seconds, and more.


Get Adobe Flash player
In the movie above the date is displayed in a label lblDate:
var d:Date=new Date();
lblDate.text=""+d;
You could also just use trace(d);

Edit the last statement by typing a dot after d. When you do the list of methods will appear. Try tracing each of the choices from that window.

date

Download the movie


INDEX, Introduction to the Date Class, The Date, A Digital Clock, An Analog Clock (with hands)
Next lesson: Examples

Copyright © Zebra0.com
All rights reserved worldwide.

 
 

Introduction to the Date Class