# Change Date Format

**URL:** https://forum.kirupa.com/t/change-date-format/157809
**Category:** flash
**Created:** [August 4, 2005, 1:20pm UTC](https://forum.kirupa.com/t/change-date-format/157809 "2005-08-04T13:20:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dwight](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@Dwight](https://forum.kirupa.com/u/Dwight)
#### Post date: [August 4, 2005, 1:20pm UTC](https://forum.kirupa.com/t/change-date-format/157809/1 "2005-08-04T13:20:58Z")

</div>

Ok here’s the deal, I’m working with Flash MX and wrote this script:

```auto

timeDataObj = new Date();
localtime = timeDataObj.getDate();
   if (localtime>= startdate && localtime<= enddate) {
	  placeholder.loadMovie(image);
   }else{
		 trace("error");
}

```

The variable “startdate” and “enddate” are coming from a XML file and are writen like: 04082005  
Now I want timeDataObj.getDate(); getting formatted to the same format as I used in the XML file. can someone help me here?

PS. Excuse for the bad english :hugegrin:
