Setting the Hours, Minutes, Seconds, and Milliseconds : Date : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Date »

 

Setting the Hours, Minutes, Seconds, and Milliseconds


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var dSometime:Date = new Date(202001);
        dSometime.setHours(5);
        dSometime.setMinutes(30);
        dSometime.setSeconds(5);
        dSometime.setMilliseconds(900);
        trace(dSometime.toString());
        dSometime.setMilliseconds(1000);
        
        dSometime.setSeconds(5);  // Set the seconds value back to 5
        dSometime.setMilliseconds(-1);  // 05:30:04:999
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» Date