VIDEO: Arithmetic Operations with Date and Time on ActionScript

Tue, Jan 5, 2010

ActionScript

VIDEO: Arithmetic Operations with Date and Time on ActionScript





How to add minutes hours, even days on a date using the get time and set time methods.


Here is the Adobe Reference.

HERE IS THE SOURCE CODE!

//The Add Hour and Day on ActionScript 30
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

var myDate:Date = new Date();
// by default new dates recieve
// system date and time

//Arithimetic operations are done
// in milliseconds. Let’s create a few
// variables to handle that…

var minutesMilliseconds:uint = 1000 * 60;
var hoursMilliseconds:uint = 60 * minutesMilliseconds;
var daysMilliseconds:uint = 24 * hoursMilliseconds;

//let’s add a day

myDate.setTime(myDate.getTime()+ daysMilliseconds);

trace (myDate);

// Thanks for watching!

Related Articles:

, , , , , , , , , , , , , , , , ,

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


1,260
Unique Visitors
Previous 30 Days
Powered By Google Analytics