Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 12 of 12

Thread: change DATE

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default change DATE

    how can i convert and print the current time/date based on the Shamsi
    calendar!
    i mean if the user type : "12th of july 2012" change it to based time on Shamsi ?
    and what is the code that can get the current time!!! (from PC or other ways!!!)


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    Shamsi?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: change DATE

    Quote Originally Posted by Norm View Post
    Shamsi?
    yes shamsi
    the format of date in ASIA , for example IRAN

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    Have you looked at the Locale class?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Nov 2012
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: change DATE

    Quote Originally Posted by Norm View Post
    Have you looked at the Locale class?
    i mean SOLAR,
    Shamsi=SOLAR
    get it?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    Sorry, I have no idea what you are trying to do.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: change DATE

    Hello
    in Iran the calendars write based on the solar year that called "Shamsi calendar ".for example year 2012 in Gregorian calendar equal to year 1391.
    now I want to write a program in java with SimpleDateFormat, that when String Pattern = "*yyyy.MM.dd HH:mm:ss"; String Date = "2000.12.07 02:08:56";
    If a pattern begins with the letter “*”, convert and print the current time/date based on the Shamsi calendar!
    can you help me?
    thank

    --- Update ---

    The other question is: who we can get two line input from command line argument and then change line to two String?
    for example:
    in command line argument:
    abcdef
    ghijk
    then in Main:
    String a="abcdef";
    String b="ghijk";
    thank

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    input from command line argument
    The arguments on the command line are passed to the main(String[] args) method in its String array argument: args
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: change DATE

    it means some thing like this?
    String a= args[0];
    String b = args[1];

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    Yes, that would copy two String references from the args array to some other variables.
    If you don't understand my answer, don't ignore it, ask a question.

  11. #11
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: change DATE

    OH!yes it worked
    thank you

    --- Update ---

    And do you have any idea about Shamsi calendar ?
    do you get what is it?

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: change DATE

    Try asking on google. Someone must have done that before.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. change Name
    By anis.laghaei in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 3rd, 2012, 05:40 PM
  2. Java Date Format in Date Object
    By Ashr Raza in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 13th, 2012, 10:47 AM
  3. Parsing a full date/time/timezone date to "yyyy-MM-dd"
    By Occidentally in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 4th, 2012, 08:57 AM
  4. Replies: 1
    Last Post: July 22nd, 2011, 07:08 AM
  5. same date should entered in another date field
    By shashib09 in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: July 14th, 2011, 08:42 AM