7 Years
Discussion Span
Last Post by JasonHippy

oh, well I found out a way.

var time:Number;
var timestamp:Number = 1283297261; // Should be unix timestamp, divide by 1000 if its a microsecond timestamp.
time = Math.min(timestamp / 86400);
time = answer*timestamp;

Or you could use a 'Date' object... Date is a globally defined intrinsic class/type in AS3 so you don't need to import anything to be able to use it.

var today:Date = new Date(); // constructor sets a new Date object to the current system date/time by default
var current_time:number = today.valueOf(); // valueOf returns the number of milliseconds since midnight on january 1st 1970 (universal time!)

The Date class has loads of different options to return the date in various formats.
I think valueOf() is most likely the one you're after. Otherwise take a look at the documentation for the Date class. I'm sure you'll find a function in there that will suit your needs!

Cheers for now,

Edited by JasonHippy: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.