Date and Time Calculations – Actionscript 3.0

Date and Time Calculations – Actionscript 3.0

I you ever wanted to calculate the minutes , hours , days … years between 2 different dates in ActionScript 3 : this is how!

What will we need?

  1. first of all download the source file we will need to make these calculations in no time
  2. unzip the zip file and save those files into the project directory

Little information about the Date variable type

Constructor Parameters

Constructor Parameters

Creating a new Date variable in flash can be done using the new Date function followed with setting the properties.

Blanc Date Constructor

Blanc Date Constructor

Leaving the constructor blanc will create a new Date variable according to the current Date / Time of the local machine
Calculations with Dates

Calculations With Dates

Calculations With Dates

Different calculation types of the DateUtilities

Calculation Types

Calculation Types


Also interesting reads:

  1. Upload Multiple Files with ActionScript 3
  2. Singleton Design Pattern Actionscript 3
  3. Object-Orientated Programming in Flash Lite 2.x

About the Author

Daan is a Creative-Geek with passion for Adobe Flash , Flex and Air. He loves learning and sharing new techniques! Follow him on Twitter to keep up to date with the Creative-Geeks blog and other subjects. Contact him on e-mail : info[at]creative-geeks.com