A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Date/Time

  1. #1
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160

    Date/Time

    Usually when we use the below code, we only get the date and time from the users computer. So if the user has wrong timeset in his computer, flash still fetches the wrong data. Is it possible to get the right date and time irrespctive to the one fetched from the computer so that the user can trust on the Date/Time shown in a flash website(even if his computer shows it wrong) ??
    Code:
    nowdate = new Date();
    	array_days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    	theday = "["+array_days[nowdate.getDay()]+"]"+nowdate.getDate()+"/"+parseInt(nowdate.getMonth()+1)+"/"+nowdate.getFullYear();
    	thetime = nowdate.getHours()+":"+nowdate.getMinutes()+":"+nowdate.getSeconds();

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Make flash retrive the server time instead:

    Have your flash file call a php file which echoes back the date/time to it.

    Have a look at http://www.w3schools.com/php/php_ref_date.asp for php date functionality
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    Do i need a server to read data from a php file onto flash ??
    Currently i am just uploading files into a free webhosting service

    Thanks for the tutorial link

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