# Displaying date tut (MX)

**URL:** <https://forum.kirupa.com/t/displaying-date-tut-mx/9594>\
**Category:** flash\
**Created:** [December 14, 2002, 7:20pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594 "2002-12-14T19:20:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pjc4real](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@Pjc4real](https://forum.kirupa.com/u/Pjc4real)\
**Post date:** [December 14, 2002, 7:20pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/1 "2002-12-14T19:20:37Z")

</div>

Hey guys!

I have just successfully used Kirupa’s tut for displaying the date. However, I am always interested in how the code actually works.

This is one for a scripter eg DAVID\<:}

(Below is a portion of the script)

```
now = new Date();
nDate = **now**.getDate();
nYear = now.getFullYear();

```

How does the syntax **now** work? Obviously it retrieves the info eg getDate, but wot is actually happening when **now is** executed??

Thanx!

---

<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:** [December 14, 2002, 8:21pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/2 "2002-12-14T20:21:58Z")

</div>

Well look at the code…

\<B\>now\</B\> = new Date();  
nDate =\<B\>now\</B\>.getDate();  
nYear = now.getFullYear();

“now” is the variable that contains the new Date() object.

So you use the new Date() object to retrieve the time. That is how you are able to use the get commands like getDate, getFullYear, etc.

I hope that makes sense 🙂

---

<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:** [December 14, 2002, 8:28pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/3 "2002-12-14T20:28:11Z")

</div>

Hey thanx… yep, it is a bit clearer now.

The thing is I’m kumming from the design side, and trying to get more involved in the development side, so ActionScript (in fact most languages) are kina foreign to me!☹

I think I need to buy a book that can give me a solid grounding on the concept of AS language - I want it to be fluent like its my second language!!!

Kirupa reviewed and rated a book a few weeks back; I mite try that unless u can recommend one…

Thanx again

---

<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:** [December 14, 2002, 8:29pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/4 "2002-12-14T20:29:37Z")

</div>

I have never used a book before, but I hear Colin Moocks book, I believe it is called AS: The Definitive Guide or something along those lines, is a great start for Flash MX AS starters.

---

<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:** [December 14, 2002, 8:31pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/5 "2002-12-14T20:31:01Z")

</div>

Ok… yeh I’ve heard about him before…  
Thanx again

---

<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:** [December 14, 2002, 8:33pm UTC](https://forum.kirupa.com/t/displaying-date-tut-mx/9594/6 "2002-12-14T20:33:11Z")

</div>

[www.moock.org](http://www.moock.org)

He is great, so is Keith Peters at [www.bit-101.com](http://www.bit-101.com) (he writes for The Friends of Ed)

The Friends of Ed are incredibly excellent… [http://www.friendsofed.com/](http://www.friendsofed.com/) , but their books are advanced, so you might want to look in them for later.

I am thinking about buying a book soon, hmmm, maybe I should take my own advice 🙂
