Construct string object from a date type value : Convert to String « Data Type « Flash / Flex / ActionScript






Construct string object from a date type value

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var dToday:Date = new Date();
        var sDate:String = new String(dToday); 
        
        trace(sDate);
    }
  }
}

        








Related examples in the same category

1.Use String() to convert integer to string
2.Numbers preceding the value that is converted to a string will be added rather than concatenated
3.Number and int data types have a toString( ) method available
4.Add two number values in the middle of a string concatenation statement