Results 1 to 6 of 6
  1. #1
    arunnorbert is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default Converting Date from one format to another without using SimpleDateformat

    Converting Date from one format to another without using SimpleDateformat -

    In google i find examples, which are using the SimpleDateFormat, Any idea how it can be done without using this SimpleDateFormat.

    Full code will be helpful.

    Please reply ASAP.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by arunnorbert View Post
    Converting Date from one format to another without using SimpleDateformat -

    In google i find examples, which are using the SimpleDateFormat, Any idea how it can be done without using this SimpleDateFormat.

    Full code will be helpful.

    Please reply ASAP.
    1) Why not use SimpleDateFormat?
    2) Full code should be provided by you.
    3) Stating ASAP will be counter productive for you. Please read this to see why: Urgent Questions

  3. #3
    autumnleaf is offline Member
    Join Date
    Dec 2010
    Posts
    2
    Rep Power
    0

    Default

    you can create a class that contians year,month,day,hour and so on,
    then you should make methods that can read data in certain formats,
    at last you make methods that convert data from one methods to another.
    make some constructor methods will be better.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    Quote Originally Posted by autumnleaf View Post
    you can create a class that contians year,month,day,hour and so on,
    then you should make methods that can read data in certain formats,
    at last you make methods that convert data from one methods to another.
    make some constructor methods will be better.
    And you can reinvent the wheel, too. Just make sure it doesn't end up square instead of round.

    db

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    Quote Originally Posted by arunnorbert View Post
    Converting Date from one format to another <snip/>.
    Date doesn't have a format. The String representation of a Date has a format.

    A Java Date encapsulates a long value equal to the milliseconds since a certain instant of time called the Epoch, defined as the start of January 1 1970 in GMT/UTC(?)

    db

  6. #6
    autumnleaf is offline Member
    Join Date
    Dec 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    Date doesn't have a format. The String representation of a Date has a format.

    A Java Date encapsulates a long value equal to the milliseconds since a certain instant of time called the Epoch, defined as the start of January 1 1970 in GMT/UTC(?)

    db
    I mean you can make a Data class yourself,and you can define some format in string such as: "dd\mm\yy",and you can print out the time you memried in the format you give.

Similar Threads

  1. Replies: 1
    Last Post: 10-15-2010, 09:58 AM
  2. converting string (GMT date) to date in US time.
    By JRuyechan in forum New To Java
    Replies: 1
    Last Post: 10-15-2010, 08:07 AM
  3. converting .pdf to .doc(microsoft word)format
    By ashik03 in forum Java Applets
    Replies: 1
    Last Post: 01-30-2010, 03:07 PM
  4. julian date to full date format
    By judy318 in forum New To Java
    Replies: 7
    Last Post: 11-02-2009, 01:17 PM
  5. Converting ASCII format
    By right2001 in forum New To Java
    Replies: 7
    Last Post: 02-17-2009, 04:55 PM

Posting Permissions

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