A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Convert timestamp to readable date

  1. #1
    Senior Member
    Join Date
    Feb 2007
    Posts
    153

    Convert timestamp to readable date

    Hello.

    I have a timestamp in the form "1239315541" and I need to convert it to a readable date.

    How can I do that ? Is there a function that I can use ? Please help.

    (I am using Flash 8 and ActionScript 2.0.)


    I am looking forward to your help.

    Thank you.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    something like this ??
    PHP Code:
    var d:Date = new Date(1239315541);
    trace(d); // Thu Jan 15 08:15:15 GMT+0000 1970 

  3. #3
    Senior Member
    Join Date
    Feb 2007
    Posts
    153
    Well, I tried that and I am getting a wrong date in 1970.

    Is there something else that I should be doing or the timestamp might not be working good ?
    Last edited by fido_glc; 05-13-2009 at 01:09 AM.

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    1
    something like this ??
    Code:
    var d:Date = new Date(1239315541);
    trace(d); // Thu Jan 15 08:15:15 GMT+0000 1970
    try * 1000 to get good date so the code will be

    Code:
    var d:Date = new Date(1239315541000);
    trace(d); // Fri Apr 10 00:19:01 GMT+0200 2009

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center