# Getting full date like 02/01/2003

**URL:** <https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510>\
**Category:** Uncategorized\
**Created:** [January 2, 2003, 3:00pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510 "2003-01-02T15:00:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoVB](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@NicoVB](https://forum.kirupa.com/u/NicoVB)\
**Post date:** [January 2, 2003, 3:00pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510/1 "2003-01-02T15:00:30Z")

</div>

How do you get that?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:14pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510/2 "2003-01-02T15:14:35Z")

</div>

```php

myDate = new Date()
myYear = myDate.getFullYear()
myMonth = myDate.getMonth()
myDay = myDate.getDay()
dateBox.text = myDay + "/" + myMonth + "/" + myYear

```

place a dynamic text field on the stage and name it “dateBox” [no quotes]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:16pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510/3 "2003-01-02T15:16:22Z")

</div>

Here is some code I whipped up when I was working on a new site…

```php

// This creates two ARRAYs that swap returned numbers with values (i.e. 0=Sunday, 4=Thursday & 1=January, 7=August)
onClipEvent (load) {
    days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
    months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
    timedate = new Date();
}
// This action actually calls out to the users system to grab the current date and time
// The date is grabbed from the ARRAYs earlier set
onClipEvent (enterFrame) {
    now = new Date();
    todaydate = timedate.getDate();
    day = timedate.getDay();
    dayname = days[day];
    month = (timedate.getMonth()+1);
    monthname = months[month-1];
    year = timedate.getFullYear();
    seconds = now.getSeconds();
    minutes = now.getMinutes();
    hours = now.getHours();
    if (Hours>=12) {
        ampm = "pm";
    } else {
        ampm = "am";
    }
    if (Hours>=13) {
        Hours = Hours-12;
    }
    if (length(Minutes) == 1) {
        Minutes = "0"+Minutes;
    }
    if (length(Seconds) == 1) {
        Seconds = "0"+Seconds;
    }
    currenttime = Hours+":"+Minutes+":"+Seconds+" "+ampm;
    currentdate = todaydate+"/"+month+"/"+year;
    fulldate = dayname+", "+monthname+" "+todaydate+", "+year;
    delete timedate;
    timedate = new Date();
}

```

Probably foreign if you dont understand the script so I was kind enough to zip a fla with the source and code in there. This also has the time, but if you want to remove it just delted the time textbox, I wouldn’t suggest editing the code.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:34pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510/4 "2003-01-02T15:34:19Z")

</div>

Also, since they replied as well, here is a tutorial that I wrote that gets the date and time. You can modify the code to get just the date:

[http://www.kirupa.com/developer/actionscript/digital\_clock.asp](http://www.kirupa.com/developer/actionscript/digital_clock.asp)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:51pm UTC](https://forum.kirupa.com/t/getting-full-date-like-02-01-2003/10510/5 "2003-01-02T15:51:18Z")

</div>

Thanks for all this information!
