×

Discussion Board

Results 1 to 2 of 2

Thread: J2ME Dates!

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    12

    J2ME Dates!

    Hi,

    I have a string "2006-02-11T18:00:00.0000000-00:00" output from .NET webservice. I can read the string fine into my J2ME application, but can I create a date object based on this string as I don't the amount of ticks (Long value) to create it?.....

    Please help

  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: J2ME Dates!

    You have to parse the string to get the individual values of the day, month and year, and make use of the Calendar class to get your date.

    eg.
    Code:
    Calendar cal = Calendar.getInstance();
    
    cal.set(Calendar.DATE, theDate);
    cal.set(Calendar.MONTH, theMonth);
    cal.set(Calendar.YEAR, theYear);
    //same with Hours and Minutes
    
    Date dateObj = cal.getTime();

Similar Threads

  1. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  2. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25
  3. J2ME Polish 1.0 RC1!
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-06-15, 02:53
  4. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44
  5. TinyLine SVG Minute Toolkit for J2ME: version 1.4 released
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-05, 16:25

Posting Permissions

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