dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Object Date

Hybrid View

  1. #1

    Object Date

    I've got a problem with this piece of code. Sometimes the clock is one hour late but I can't see what's wrong and sometimes the clock shows the right time.

    Some help me, please.


    this.onEnterFrame = function(){
    d = new Date();
    day = (d.getDate() < 10)? "0" + d.getDate() : d.getDate();
    month = (d.getMonth() < 10)? "0" + d.getMonth() : d.getMonth();
    year = d.getYear();
    hour = d.getHours();
    minute = (d.getMinutes() < 10)? "0" + d.getMinutes() : d.getMinutes();

    str = "[ " + day + "." + month + "." + year + " - " + hour + ":" + minute + " ]";
    clock = str;

    }
    antz.digital.media
    www.antz.com.br

  2. #2
    I attached a jpg with the wrong time display.
    Attached Images Attached Images
    antz.digital.media
    www.antz.com.br

  3. #3
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Availability


    Flash Player 5.

    Usage


    myDate.getHours()
    Parameters


    None.

    Returns


    An integer.

    Description


    Method; returns the hour (an integer from 0 to 23) of the specified Date object, according to local time. Local time is determined by the operating system on which the Flash Player is running.

  4. #4
    so I must use hour = d.getHours()+1 with some corrections, of course...
    antz.digital.media
    www.antz.com.br

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center