Use UTC method to construct date object : Date : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Date »

 

Use UTC method to construct date object


 

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

        var dLocal:Date = new Date();
        dLocal.setUTCFullYear(1970);
        dLocal.setUTCMonth(0);
        dLocal.setUTCDate(1);
        dLocal.setUTCHours(0);
        dLocal.setUTCMinutes(0);
        dLocal.setUTCSeconds(0);
        dLocal.setUTCMilliseconds(0);
        
        //using the UTC() method, you could write the same thing in this way:
        
        var nUTCDate:Number = Date.UTC(197001);
        var dLocal:Date = new Date(nUTCDate);

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Development
» Date