Data format - Help needed!!!!!

I have a String with this value:"Thu Dec 19 09:23:49 2002" ;
is there a java method to convert it automatically in another string to this format: "19/12/2002" or "12/19/2002" (it depends on italian date)
thanks all!!

As dateString does not seem to be a proper Java term (unless Mr sssako knows something I do not) I would be a string.
You could do it with two instances of SimpleDateFormat, one set up for the format of the string you have and one set up for the format you want.
You then call parse() on the first one to get a date and use that date as the parameter to a call to format on the second one.
String s = "Thu Dec 19 09:23:49 2002";
SimpleDateFormat input = new SimpleDateFormat("E MMMM d HH:mm:ss yyyy");
SimpleDateFormat output = new SimpleDateFormat("dd/MM/yyyy");
try
    s = output.format( input.parse(s) );
    System.out.println(s);
catch ( ParseException e )
    e.printStackTrace();
}

Similar Messages

  • Date Format help needed

    Hello Friends,
    I need to mormat my date valye to get something like the following:
    Sunday December 3rd, 2006 OR
    Tuesday December 5th, 2006
    I understand that one can give a custom format for date as per the SimpleDateFormat symbols. However, I did not find anything for achieveing the pattern in bold
    Can you please help?
    Regards,
    Leena

    umm.. did not think about it..
    I thought on it after reading your post.
    My first thoughts for writing my own formatter are that I will have to extend the SimpleDateFormat class, right?
    Not sure what do I do next.. :(
    Regards,
    Leena

  • Date Format Help: DD-MON-YY

    Hello everyone.
    Good Day.
    I would like to seek your help regarding my inquiry on the PL/SQL script output that I am trying to create.
    Please see below output of my script:
    L7,CU4450278,70X1W01AGA-ASY,11813,20-6æ -13,0
    L7,CU4464442,747X32VH9015-ASY,3394,20-6æ -13,0
    L7,CU4464766,747X22VH9015-ASY,3383,21-6æ -13,0
    As you can see in the CSV output, the date has some invalid value, the "6æ " should have been Jun (i.e. Short Month format of June).
    My script has this code for date dbms_output to_char(startplan_rec.str_startdate,'DD-MON-YY')
    The startplan_rec.str_startdate data type is date.
    I have tried querying the same table in the oracle sql developer, but i am getting the correct output (e.g. 20-Jun-13).
    Please help me on having my desired date format output on my pl/sql. Why is my date output on my script incorrect?
    Thanks in advance.
    Regards,
    Jeff.

    JEFTPHPH wrote:
    Hi Hoek:
    I am using sql plus for the project.
    I was just following a certain format from a requirements that is why I am still using the YY thing.
    BTW, I've heard about the Y2K thing when i was on college.
    THanks,
    Jeff.
    Boy does that make me feel old.  A few years ago I was at a workshop when a young developer expressed to me his opinion that Y2K was a hoax.  His "proof" was the fact that "nothing happened after all."  I had to explain to him that reason it seemed "nothing happened" is because armies of guys like me had spent two years busting our butts fixing the problem before the excrement collided with the ventilation system.
    But I have code that is older than his birth certificate.

  • Date Format Function Needed

    Hi All ,
    I need date format in the following format 2009-01-28T09:09:38.0Z...
    please let me know how can i get this

    The Z in a time string typically refers to Zulu time or Greanwich Mean Time, so if you need the zulu time you need to convert your date to a timestamp containing time zone information and shift it to GMT time then format the output as required like so:
    with sample_data as (select to_date('2009-01-28 9:09:38','RRRR-MM-DD HH24:MI:SS') dt from dual)
    select to_char( cast( dt as timestamp with time zone) -- Cast the date to a timestamp containing time zone
                          at TIME zone 'GMT'              -- shift the timestamp to the UTC time zone
                  , 'YYYY-MM-DD"T"HH24:MI:SS.FF1')||'Z'   -- Format the timestamp as a character string
      from sample_data;

  • Date Format help req

    Hi all,
    Can u pls let me know how to subtract 1 millisecond from this '01-OCT-09 12.00.00.000000000 AM' date format.
    Thanks in Advance

    p78 wrote:
    Hi all,
    Can u pls let me know how to subtract 1 millisecond from this '01-OCT-09 12.00.00.000000000 AM' date format.
    Thanks in Advance1 millisecond is (1/((24*60*60)/1000))

  • Address Format Help Needed

    Could someone please direct me to some information explaining how Apple deals with Address Formats?
    I upgraded to Snow Leopard, then synced. I was syncing from what a perfect version which I had saved on Mobileme before upgrading, and I had not changed anything on the computer after upgrading. I expected it to be straightforward. However, I was told that I had 730 conflicts in Address Book. (That's half my records). When I started to go through these conflicts, I found that they all had something to do with Address Formats. One version, for example, had format 'Japan', and was formatted one way, and another version, had format 'ja', and was formatted another way. Also, sometimes I had 'United Kingdom', and sometimes 'uk'. Actually, there were all sorts of strange conflicts, which is why I'd appreciate some general information that I can study.

    Using 'Reset Sync Data', I uploaded a perfect version of my contacts from an ibook running 10.4.11. It was when I tried to download this onto another, new, computer using 10.6 (again using 'Reset Sync Data' that all these conflicts came up. There was nothing on the latter machine for there to be a conflict with.
    Thanks for your advice, but if I always choose the side with the full name, then I will be sometimes choosing a side that has an incorrectly written address. And I'm afraid I don't want to have to spend a morning doing this 730 times, as very often I also need to check the address from the original computer.
    What I'd like to know is if there is a way to do this without these conflicts. I suppose I could just copy/paste the address data, but then next time I sync, will I get the conflicts again? Why is this happening? What are these two letter codes?

  • Duplicate Data Fields Help Needed

    We have a 9 page Word form that has some duplicate information, have converted it to LiveCycle but am stuck on finding out how to have the data from one field also show in another so the user does not have to enter twice.  Eventually we will remove the duplicate fields, but for many reasons, right now they must remain.  I don't want a Contractor to have to enter their Company name twice, etc., and have my main data collection form in the front of the 9 pages, and then when they get to the last page with sigs, etc., I would like what they've already entered for their Company information to show.
    I am very new to Designer ES, and when I did some forms in Adobe 9.0 Forms awhile back, all I needed to do was to name the fields the same and if I entered info in one it would show in the other.  ES does not seem to do that, and I can't seem to find out how to add any code to the field.  Don't know why but alot of my options are grayed out.
    Anyway, would very much appreciate help, thank you.

    Giving them the same name is only one part of the solution ....you have to change the binding (on the Object palette/binding tab) to Global.
    Paul

  • Recive deleted pictures with out icloud or any back up from last restore date please help need to find a very important picture

    i have problems with spelling
    There surely has to be a way to recive my pictures from deleted memory on my iphone 4
    i deleted my pictures from this weekend and need to view them but i deleted them with out having icloud or any back up app
    is there ANY one who know's how to get around this there has to be a way like a computer like a restore factor settings that lets you go back to the last time you took a picture
    Please Help Driving me insane

    Richie K wrote:
    im still not conviced i might go to the iphone store tomorrow and see there has to be a way thank you for you help if you come across anything like this please let me know
    Good luck, but they will tell you the same thing that anyone here will tell you.
    Unless the device was backed up (via iTunes or iCloud) after the pictures were taken but prior to deleting them on the device, they are gone.  There is no way to recover them once deleted without a backup.

  • Trying to update Project scheduled finish date - newbie help needed!

    Guys, I am super new to Oracle Projects, I have never used it before.  I've just learned a few things in the UI and read through the docs documenting the stored procs.  My question is simple (hopefully)   In the UI I choose a responsibility, then under "Projects : Delivery" I choose "Search Projects", I enter the Project ID in the field and click Go, I am able to see all the project details and the Tasks.  No problem there!  What I would like to do through the Update_Project API is to change the "Scheduled Finish Date" of the Project.
    I have the following information that I have managed to scrape up:
    Project_id, Responsibility_id, User_id, Resp_Appl_Id
    I retrieved the project id using:
             Select project_id,name from pa_projects_all
              where name = 'My Project';
    So first I call set_global_info with the appropriate parameters, then this:
        -- SET GLOBAL VALUES
         pa_interface_utils_pub.set_global_info(
         p_api_version_number => 1.0,
         p_responsibility_id => fnd_profile.value('57203'),
         p_user_id => fnd_profile.value('1013415'),
         p_msg_count => l_msg_count,
         p_msg_data => l_msg_data,
         p_return_status => l_return_status);
         l_project_in.pa_project_id := 4608;
         l_project_in.scheduled_finish_date := to_date('2008-02-27', 'YYYY-MM-DD');
      --UPDATE_PROJECT
              pa_project_pub.UPDATE_project(
                        l_api_version_number,
                        p_commit => l_commit,
                        p_init_msg_list => l_init_msg_list,
                        p_msg_count => l_msg_count,
                        p_msg_data => l_msg_data,
                        p_return_status => l_return_status,
                        p_workflow_started => l_workflow_started,
                        p_pm_product_code => null,
                        p_project_in => l_project_in,
                        p_project_out => l_project_out,
                        p_key_members => l_key_members,
                        p_class_categories => l_class_categories,
                        p_tasks_in => l_tasks_in,
                        p_tasks_out => l_tasks_out);
    What I am getting is the message "error :Project ID is invalid" and the status is "E"
    I'm not sure why it is invalid as it is the exact Project ID from the projects table.  The only thing I can think of is that the p_pm_product_code is set to null but I am not sure where this value comes from and why it even matters.  I checked the documents and it says it refers to some external system.  Why does the external system code matter if I am changing data within Oracle Projects?

    Hello,
    Looks like you are not setting the Initialization values correctly. Oracle Project APIs are Org specific and require proper initialization before being called for them to work.
    Few things i noticed from the code is :
    1.  The following is being used to set the User ID and Responsibility ID  :
         p_responsibility_id => fnd_profile.value('57203'),
         p_user_id => fnd_profile.value('1013415'),
    I think the call should be like this. This should be used only if you are going to call the API through a concurrent program from the submit request window (Oracle Apps environment). fnd_profile.value will get the responsibility id and the used id of the user running the program and assign it to the variables.
         p_responsibility_id => fnd_profile.value('RESP_ID'),
         p_user_id => fnd_profile.value('USER_ID'),
    Or If you are directly passing the IDs hardcoded then, This can be used if you are running the script from a Non-Oracle Applications environment, for example from SQL*Plus.
         p_responsibility_id => 57203
         p_user_id => 1013415
    2. I notice that you are not passing P_OPERATING_UNIT_ID parameter in the call to pa_interface_utils_pub.set_global_info. This is fine if you are not using MOAC  and you have set MO: Operating Unit profile for the responsibility being passed.  If you are using MOAC or are not sure, then it is always a good practice to explicitly  pass the P_OPERATING_UNIT_ID parameter in the call to pa_interface_utils_pub.set_global_info.
    Note :  DO NOT use fnd_profile.value('ORG_ID') to set the P_OPERATING_UNIT_ID parameter. In a MOAC environment this may not work.
    3. Always ensure you check the return status of the pa_interface_utils_pub.set_global_info for success before calling the Project APIs. This will save you a lot of frustration when testing.
    4. You might find the following note useful
    Project API Overview and Reference (Doc ID 1424156.1)
    Regards,
    Raghavan Gopalakrishnan

  • Date format help

    Hi,
    select to_char(SYSDATE,'MMDDYYYYHHMISS') from dual;
    Ouput:
    10082012010338
    It is giving me correct output, but i want to display even the Fraction of seconds, how can i?
    I have tried this..but not working..
    select to_char(SYSDATE,'MMDDYYYYHHMISSFF') from dual;
    Output: Error.
    Please help me in this.
    Thanks.
    Edited by: 910575 on Oct 8, 2012 1:05 AM

    910575 wrote:
    Hi,
    select to_char(SYSDATE,'MMDDYYYYHHMISS') from dual;
    Ouput:
    10082012010338
    It is giving me correct output, but i want to display even the Fraction of seconds, how can i?
    I have tried this..but not working..
    select to_char(SYSDATE,'MMDDYYYYHHMISSFF') from dual;
    SYSDATE doesn't have fractions of seconds.
    Output: Error.
    Please help me in this.
    Thanks.
    Edited by: 910575 on Oct 8, 2012 1:05 AM

  • Design / Formatting Help Needed

    Good Afternoon,
    I am in the process of developing a help system to support a
    proprietary green screen application that we use in our
    organization… the green screen application is very convoluted
    and all steps/processes etc to be completed in the system have many
    many steps to complete. In order to not overwhelm the end user, in
    any given help topic there are multiple subtopics that are
    “hidden” until the DHTML dropdown hot spot is
    activated.
    Within each hotspot, there are also “sub hot
    spots”. However, this is confusing to the user… there
    are so many hotspots etc (both hotspots from the main topic page
    and “sub” hotspots within a hotspot) that the user is
    losing track of where they are at.
    I was wondering if anyone had an general design
    recommendations or best practice recommendations that I should be
    adhering to in order to eliminate this confusion.
    Thanks!

    I've used hotspots within hotspots without issues. I suggest
    you break the information into smaller chunks if you can. If a
    particular task is very long, consider making it a book instead of
    a single topic. For example, if you assign one topic to each of
    five tasks, but the third task involves six steps, turn the third
    task into six steps/topics, and bind them as a book in your Help
    file. So you'll go from this:
    1. Task 1 (single topic)
    2. Task 2 (single topic)
    3. Task 3 (single topic)
    4. Task 4 (single topic)
    5. Task 5 (single topic)
    To this:
    1. Task 1 (single topic)
    2. Task 2 (single topic)
    3. Task 3 (one book with six topics)
    4. Task 4 (single topic)
    5. Task 5 (single topic)
    This kind of solution should cut down on some of the
    nesting.

  • Date Format IN BDC

    Hi,
    In One Interview I was asked that How can You Handle Data Format when Writing BDC ?

    Satya,
    The date format depends on User settings. Its different for different login ID's.
    It can be YYYY.MM.DD or MM.DD.YYYY or anything.
    To handle the date format, you need to query on table USR01 and fetch DATFM field that stores date format.
    Refer below piece of code
    */...Fetch the date format settings for the user
          SELECT SINGLE datfm
                   INTO gv_date_format
                   FROM usr01
                  WHERE bname = sy-uname.
      CASE gv_date_format.
        WHEN 1.     "DD.MM.YYYY
          CONCATENATE fv_impdate+6(2) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 2.     "MM/DD/YYYY
          CONCATENATE fv_impdate+4(2) '/'
                      fv_impdate+6(2) '/'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 3.     "MM-DD-YYYY
          CONCATENATE fv_impdate+4(2) '-'
                      fv_impdate+6(2) '-'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 4.     "YYYY.MM.DD
          CONCATENATE fv_impdate+0(4) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 5.     "YYYY/MM/DD
          CONCATENATE fv_impdate+0(4) '/'
                      fv_impdate+4(2) '/'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 6.     "YYYY-MM-DD
          CONCATENATE fv_impdate+0(4) '-'
                      fv_impdate+4(2) '-'
                      fv_impdate+6(2) INTO fv_expdate.
      ENDCASE.
    This would convert the date into the format set for user.
    Hope this is helpful.
    Amogh

  • Date Format Error in Jtable

    Can Somebody Guide me.I have a table in mysql database on windows 2000 which contains a short date field.Now my probem is that when I submit date values 10/01/2006 .It is entered in database as 29/12/1899 .I searched a number of websites also but nothing could help me.some examples will be helpful.
    Thanks
    sushil singh

    What's the value of inserQuery? If you print out its value and run it directly on the database does it do what you expect?
    It's often better to use a PreparedStatement to execute updates on the database:
    PreparedStatement stmt = conn.prepareStatement("INSERT INTO my_table VALUES (?)");
    stmt.setDate(1, myDate);
    stmt.executeUpdate();That way you don't have to worry about what date format you need to convert your dates into to put them into the database.
    Hope this helps.

  • Date format in a JTextField

    I have created 2 jtextfields to enter a start and stop date for printing a report within the date range selected. How do format the jtextfields to insure they are properly date formatted i.e. MM/dd/yyyy
    Thanks, William

    If you create an input binding of Formatted Text Field, you can specify the format mask by right-clicking the binding and clicking "Edit" from the structure pane. Then select "Format" and set whatever date format you need. This is true in 10.1.2, so it might not be available depending on what version you are using.

  • Convert the date into user default date formate

    I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...

    actually by using dats or d type you can get the user specific date itself.
    but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
    1. retrieve the user format from usr01
        SELECT SINGLE datfm
          INTO w_datfm
          FROM usr01
         WHERE bname EQ sy-uname.
    pass w_datfm to the below FM (4th import parameter)
    2. create Z - FM and retrieve the user secific date
    FUNCTION ZFXX_USER_SPECIFIC_DATE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IW_DAY) TYPE  CHAR2
    *"     VALUE(IW_MONTH) TYPE  CHAR2
    *"     VALUE(IW_YEAR) TYPE  CHAR4
    *"     VALUE(IW_DATFM) TYPE  USR01-DATFM
    *"  EXPORTING
    *"     VALUE(EW_USER_DATE) TYPE  CHAR0008
    *1  DD.MM.YYYY
    *2  MM/DD/YYYY
    *3  MM-DD-YYYY
    *4  YYYY.MM.DD
    *5  YYYY/MM/DD
    *6  YYYY-MM-DD
    CASE iw_datfm.
      when '1'.
        concatenate iw_day iw_month iw_year
               into ew_user_date.
      when '2'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '3'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '4'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '5'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '6'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when others.
        clear ew_user_date.
    endcase.
    ENDFUNCTION.

Maybe you are looking for

  • From Tiger to Leopard (on to Lion)

    Leaving the PBG4 Ti for MBA. Can't move all the applications to Lion from Tiger so I upgraded to 10.5.1 using Archive and Install (saving previous system). Have repaired Permissions using Disk Utility 11.0 (252). Installed Combo update 10.5.8 after r

  • USB message when IPhone plugged in to MacBook Pro

    I have a MacBook Pro running Lion. When I plug in my IPhone 5 a message appears saying one of the USBs is overloading the system and it needs to power down. I've checked all connections. I'm running a Cinema screen from the laptop and two printers, o

  • Not Matching info on iTunes & iPod

    I primarily use my iPod at work. My PC is often used by other employees in the evening. Today, when I plugged in my iPod, another persons info popped up. ie: His iPod name and songs were listed. BUT NONE of my info or songs were listed. When I discon

  • Email Signature Prompt

    I have a GroupWise resource that several people use to send emails out, and the policy is that they must include their name in the email so the receiver knows who in that department actually sent it. The problem is they sometimes forget to include th

  • Photoshop CS4 and the mysterious vanishing marching ants...

    About ten minutes ago, as I was cropping photos in Photoshop CS4, the marquee tools suddenly lost their marching ants. Now, when I click on the rectangular marquee tool and move the cursor to select an area, the outline of the selected area is invisi