Results 1 to 2 of 2

Thread: Easy Date conversion

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    122

    Easy Date conversion

    Probably a simple one, but I am scared of Java. I have a date in DDMMYYYY format. I want to change it to MMDDYYYY and insert '/' in the proper places. What is the function to use?
    Last edited by JonathanSchmidt; Nov 13th, 2002 at 10:33 AM.

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Code:
    Javascript:
    var str = new String("ddmmyyyy"); 
    str = str.substr(0,2) + "/" + str.substr(2,3) + "/" + str.substr(5,4);
    //substr(beging,length)
    
    Java kinda the same except
    String str new String("ddmmmyyyy");
    //substring(int beginIndex, int endIndex)

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