×

Discussion Board

Results 1 to 5 of 5

Thread: Time Date

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    8

    Time Date

    Hallo,
    I got the Nokia 7210.

    Now I wrote a application for it.

    I will make a second version with a better userinteface.

    So I will to know:
    How can I, with the "7210 MIDP SDK", view a date? I saved the date as long (millisecond 'til 1. Jan 1970) and i wand to view it as String like "21. July 2003" or "21. July 2003 07:50"....


    Can U help me?

    Thanx a lot!

    Cheers Martin

    PS: A nice week

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393
    Use the Calendar class.

    [N]/Forum Nokia

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    I'm using a Calendar like this:

    Calendar cal = Calendar.getInstance ();
    cal.setTime (timeInMilliseconds);

    stringFormOfDate = cal.toString ();

    One problem is: the Calendar doesn't seem to know what timezone it's in - I always get GMT, even though we're on summer-time here in the UK.

    I haven't tried it with the simulator set to different locales yet, so I don't know the range of text formats it might produce. Any information on that, I'd be interested.

    Cheers,
    Graham.

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    75
    protected void paint( Graphics g) {
    long date;
    g.setColor(0x000000);
    g.drawString("" + date,0,0,g.TOP|g.HCENTER);
    }

    is this help u??? sorry if i miss understand

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    8

    thanx

    Hi graham,

    thanx for helping me with the DateTime and Calendar.

    It's more different then I thought!

    OK everithing looks allright.

    With timezone (i'm still in switzerland GTM+01:00) and all the stuff it works almost I wanna to.

    I did the "formating of date" by my self because running is more importend then goodlooking!:-)

    My First Version of the Windsurfing-Diary is completed.

    Thanx a lot

Posting Permissions

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