What is the (system)Date? Year, Month, Day, and Second.

March 2nd, 2008

One thing about Director is that the help files are often missing things. One key thing is time (I heard it keeps on ticking). Think about all these different things (roughly grouped) – feel free to start typing in the message window.

the ticks
_movie.ticks()

the milliseconds
_system.milliseconds

the date
the long date
_movie.date()
_system.date()

the time
the long time
_movie.time()
_system.time()

the systemDate
_movie.systemDate()
_movie.systemDate().year
_movie.systemDate().month
_movie.systemDate().day
_movie.systemDate().seconds

What are all these things? Well…some are old, some are new, some are undocumented, and some are blue (ok…maybe not). Running a little script to show each of those items you get the following:

— “2861209 = the ticks”
— “2861210 = _movie.ticks()”

— “47686843 = the milliseconds”
— “47686848 = _system.milliseconds”

— “3/2/08 = the date”
— “Sunday, March 2, 2008 = the long date”
— “3/2/08 = _movie.date()”
— “3/2/08 = _system.date()”

— “8:14 PM = the time”
— “8:14:21 PM = the long time”
— “8:14 PM = _movie.time()”
— “8:14 PM = _system.time()”

— “date( 2008, 3, 2 ) = the systemDate”
— “date( 2008, 3, 2 ) = _movie.systemDate()”
— “2008 = _movie.systemDate().year”
— “3 = _movie.systemDate().month”
— “2 = _movie.systemDate().day”
— “72861 = _movie.systemDate().seconds”

Here is the really quick explanation (as far as I know).

the ticks (or _movie.ticks) are divisions of time that are equal to approximately 1/60 of a second (slight variance on different platforms/computers). I’m not sure when they start counting (i.e. when would it show 0 ticks). the milliseconds (or _system.milliseconds) are the number of milliseconds (1/1000 of a second) that have passed since it started counting – and once again, I’m not sure when it starts counting. the date, _movie.date() and _system.date() all return the same value (at least in my case). I believe that the format of these will vary based on your international settings on your computer.

the long date provides the name of the day and the month. This is older Lingo. I’m not aware of a modern way to get this value. Does anyone know of anything such as _system.date.long() that might give the same information? The long date is rather unique (or should I say old?).

the time, _movie.time, and _system.time all provide the same value, but once again, there is the long time which includes the seconds and is unique and old. Does anyone know if there is a modern (dot syntax) version of that?

the systemDate (modern version is _system.date()) provides the date in the format of (year, month, day). This is supposed to be uniform across international systems. From this date you can easily get the year, month or day as was shown above. The most interesting part is that you can also get the seconds past midnight with the _movie.systemDate().seconds.

Between all those things you can usually come up with at least one time or date that seems interesting. Of course, if you want a bit more you could also use javascript or an actionscript object via lingo to get even more times and dates.

Some interesting resources related to this:

Director Online article
Mediamacros script

Using actionscript objects with date/time:
Director Dev Center Article
ActionScript dictionary for date objects

Entry Filed under: Basic Lingo,Daily thoughts

8 Comments Add your own

  • 1. andreas  |  February 19th, 2008 at 4:44 am

    – DX9 support
    – Physics (!!!)
    – New text-engine

    Far more than expected! Yay.

  • 2. wim wouters  |  February 19th, 2008 at 8:38 am

    hiiiiihaaaaa at last!!! 😀 me happy!!!

  • 3. Fantazm  |  February 26th, 2008 at 4:18 pm

    looks promising.
    Can’t wait to get my hands on it and prototype some games with Ageia.

  • 4. Martin Schaefer  |  March 3rd, 2008 at 8:14 am

    “the ticks” and “the milliseconds” count from the last boot of your computer.

    Cheers,
    Martin

  • 5. Josh Chunick  |  March 4th, 2008 at 12:29 am

    You forgot these:

    the short date
    eg. “3/4/2008”
    the short time
    “12:24 AM”

    that’s what it shows no my pc, and it looks the same as the date and the time when testing… of course, the formatting is entirely dependent on your OS configuration for date & time.

  • 6. A Lingo Guy When the Need Arises  |  March 10th, 2008 at 11:17 am

    I tend to use BudAPI Xtra’s time functions.

  • 7. MostlyDissapointed  |  March 25th, 2008 at 5:30 pm

    So I downloaded it and gave it a look through. In my opinion this is the least impressive update since 8.5. What have these guys been doing for 4 year? It sure was not improving Director in any way.
    Way to sit on your hands guys

  • 8. Jul  |  February 11th, 2010 at 11:06 am

    Thanks for those useful informations that help seen clear through this mess.
    I’ve just spoted a typo there :
    “the systemDate (modern version is _system.date()) ”
    This is wrong. The modern version is _movie.systemDate() as noted in the code sample.
    _system.date() is the modern version for “the date” (which is evil btw).

    Cheers,

    Julien

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Director Sites

Calendar

March 2008
M T W T F S S
« Feb   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

Recent Posts

Recent Comments