×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    26

    Date Field class in J2ME

    hai friends,

    Im using the class "DateField" which is in " java.util.Date" package.

    like:
    public DateField dob=new DateField("DOB",DateField.DATE);

    Its working fine and its displaying the date as in the following format.

    Thu sep 15:00:00:00 UTC 2005

    But Can you plz tell me how to change this formate and to initialise this "dob" with a default value.


    thanks in advance.
    regards,
    yafy.

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Date Field class in J2ME

    to set a value :
    dob.setDate(Date date)
    (as far as i know, the default value is either 'epoch' either 'now')

    to change the format :
    as far as i know, you can't, and it's implementation dependent, and therefore phone-dependent (sorry)
    if you wan't to display a date with the format you want, use the Calendar class, which permits to get the informations about month, year, day, day of week ... independently, and then display it like you want, in an text field, but then you can't edit it

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    26

    Re: Date Field class in J2ME

    hi njzk2 ,

    Thanks a lot for your suggestions.
    But can u tell me whats 'epoch'.....

    regards
    yafy.

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Date Field class in J2ME

    the Unix epoch (which is used in Java) is 1st of january, 1970, 0:00 AM. It corresponds to 0 miliseconds
    (the microsoft epoch is 1st of january year 0 (even if it does not exist) 0:00 AM, and then time is counted in ticks (100 nano), on a 64 bits integer. I don't know how it handles the various dates of application of the Gregorian reforms accordingly to the countries)

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    2

    Re: Date Field class in J2ME

    I am using DateField in my app it throws applicatin err if I enter Date 4-1-2080 in nokia 2730 it works fine with other dates .
    pls give me solution

Similar Threads

  1. need information about j2me polish
    By rathikathangaraj in forum Mobile Java General
    Replies: 4
    Last Post: 2007-12-19, 09:01
  2. File Class Equivalent in j2me?
    By rj_cybersilver in forum Mobile Java General
    Replies: 8
    Last Post: 2005-04-05, 01:04
  3. how to get the sum of digits of a date from a date field
    By SangeetaVepa in forum Mobile Java General
    Replies: 0
    Last Post: 2003-09-04, 08:37
  4. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53

Posting Permissions

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