Need to parse Japanese Full Date Format

Hi,
Locale japanLocale = Locale.JAPAN;
SimpleDateFormat fullDateFormat = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, japanLocale);
String dateValue = 2010'?'09'?'12'?' 1'?'15'?'45'?'GMT // Here Japanese character will come instead of ?
DateFormat initialDateFormat = new SimpleDateFormat(fullPattern, japanLocale);
Date date = initialDateFormat.parse(dateValue);
String formattedDate = fullDateFormat.format(date);
This throws Exception java.text.ParseException: Unparseable date: "2010'?'09'?'12'?' 1'?'15'
?'45'?'GMT"
If you send some good suggestions, it will be appreciable.
Thanks in Advance
Suresh

Japanese full pattern is:
"yyyy'年'M'月'd'日' (EEEE)
H'時'mm'分'ss'秒' z"
I need to parse this string.
OK:
String pattern = "yyyy'年'M'月'd'日' (EEEE) H'時'mm'分'ss'秒' z";
String date = "2004年8月12日 (木曜日) 13時56分01秒 EEST";
SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.JAPAN);
Date d = parser.parse(date);
System.out.println(d); // prints Thu Aug 12 13:56:01 EEST 2004
Note that for the sake of portability the two first lines should be written asString pattern = "yyyy'\u5e74'M'\u6708'd'\u65e5' (EEEE) H'\u6642'mm'\u5206'ss'\u79d2' z";
String date = "2004\u5e748\u670812\u65e5 (\u6728\u66dc\u65e5) 13\u664256\u520601\u79d2 EEST";This is to make it possible to compile your code on a platform that doesn't support Japanese script.
Can i have your Yahoo / AOL ID?What makes you think I have one? :)

Similar Messages

  • I need help parsing a  swift data string

    i need to parse swift financial data
    is there a way to use split or stringtokenizer for ::
    and keep the :: as part of the new seperated data.
    i want to put each string starting with :: on a seperate line in a text box.
    i gave up and tried it with a loop and a stringbuffer , and indexof.
    if (line.indexOf("::") == Strpos ){
    frame.jTextArea1.append(displayline.toString());
    displayline = new StringBuffer();
    displayline.append(line.substring(Strpos, (Strpos + 2)));
    Strpos += 2;
    if (line.indexOf("::") != Strpos ) {
    displayline.append(line.substring(Strpos, Strpos + 1));
    System.out.println( displayline);
    Strpos++;
    but i cant get that to work either.
    if anyone knows how to parse swift data please give me your email address.
    i've been doing it in cobol for 15 yrs and i just cant get the cobol techniques to translate to java.
    thanks.

    as i said
    i am really a cobol guy
    and yes as you see i did try to use indexof in my code.
    but there must be something about indexof that i'm not getting.
    it works the first time in the loop but then as i increment my start position(strpos)
    the indsex of no longer works.
    am i using the correct technique to increment the start position thru the string buffer.
    thanks guys.

  • Need regular expression for oracle date format 'DD-MON-YYYY'

    Hi,
    Can anybody tell me the regular expression to validate date in 'DD-MON-YYYY'.
    My concept is i have a table with just two columns item_name and item_date
    Both fields are varchar2 and i want to fetch those records from this table which have valid date format('DD-MON-YYYY').

    If it must be a regexp, this is a starter for you, note it carries the caveats mentioned by both posters above and in the linked thread
    mkr02@ORA11GMK> with data as (select '10-jan-2012' dt from dual
      2  union all select '10-111-2012' from dual
      3  union all select 'mm-jan-2012' from dual
      4  union all select '10-jan-12' from dual)
      5  select
      6  dt,
      7  case when regexp_like(dt,'[[:digit:]]{2}-[[:alpha:]]{3}-[[:digit:]]{4}','i') then 1 else 0 end chk
      8  from data
      9  /
    DT                 CHK
    10-jan-2012          1
    10-111-2012          0
    mm-jan-2012          0
    10-jan-12            0It will not validate content, only string format.
    And to emphasis the points made in the linked thread - dates in text columns is poor design. Always.

  • Using parsed XML as data format for MVC implementation

    Instead of using Beans to contain the data for JSP pages I want to use XML objects. For example, a 'Document' object which represents XML data.
    I should then be able to interface easily with web services -some clients might require the raw xml string. Furtermore, I am not tied to JSP. I could use XSLT or browser based XSL stylesheets.
    The interface between my controller and processes will then also be a 'Document' instead of pre-defined methods.
    I would like to know what are the pros and cons of my approach? Is this kind of design used anywhere?

    This is not really any direct answer to your question.
    However, it may serve as food for your thoughts.
    Have you read http://java.sun.com/products/jsp/html/JSPXML.html and http://www.javaworld.com/javaworld/jw-03-2000/jw-0331-ssj-jspxml.html

  • Date format in Finder

    Swedish Leopard 10.5.2
    In the Finder's list view, is it possible to alter the date format shown? In the system settings, there are 4 different date strings available to alter (I don't want to start by altering them if I don't need to). Loosely translated from Swedish, they are called "Short", "Normal", "Long" and "Full".
    Finder displays the "Full" date format, followed by the time. I would like to change this to display the "Short" date format instead. Is this possible somehow? I know I can turn off showing dates as "Yesterday" and such, but that is NOT what I'm after. I want to display the date as set by the "Short" date format in the system settings.
    Is this possible to somehow achieve with some "defaults write" command in the terminal? I am new to OS X, but not afraid to fiddle with things like this.
    Thanks for any response on this.

    There are four different date formats in International, System preferences.
    The Finder seems to use all of these depending on the width of the time column.
    I myself don't like the appearance of the date and time changing with the width of a column.
    In particular I don't like the date with names for months; it's annoying for comparison.
    The only way to always get the same date/time in list view of the Finder is to make all date formats
    (short,medium,long,full) the same. That's what I have done and now I have what I want.
    It won't win a beauty contest.

  • Date format in BI query

    Hi,
    We need to display a single date format independent of date format of SAP User settings. For ex: as below.
    In a current query the  date, depending on the user's configuration could appear as:
    dd.mm.yyyy (English format)         or        yyyy-mm-dd (Swedish format)        or        mm.dd.yyyy (American format)
    I need to change some of the queries date format as below.
    a) Change all dates in query outputs and parameters to the format YYYYMMDD
    b) Change all months in query outputs and parameters to the format YYYYMM
    c) Change all financial periods in query outputs and parameters to the format YYYYPPP
    Thanks,
    Jitu

    Hi
    I think u have to use the ABAP code at the query level.
    First take the date in one variable zdate_var  and then if u want the below , then
    data : zdate_var_year type d,
               zdate_var_mm type d,
              zdate_var_dd type d.
    zdate_var_year = zdate_var(4).
    zdate_var_mm = zdate + 4(2).
    zdate_var_dd = zdate + 6(2).
    YYYYMM = zdate_var_year , zdate_var_mm.
    LIke this u can have ur o/p as per ur wish,
    Hope u got it ,
    Thanx & Regards,
    RaviChandra

  • RowQualifier and Date format

    I'm trying to filter a ViewObjectImpl rowset based on a RowQualifier where clause using code like :
    ViewObjectImpl voi = (ViewObjectImpl) viewObject;
    RowQualifier qual = new RowQualifier(voi);
    qual.setWhereClause(ATTRIBUTENAME+"="+value.toString());
    Row[] filteredRows = voi.getFilteredRows(qual);
    which works fine for numbers, and for strings if I put some single quotes around the value. It doesn't work when dates are involved tho, always returning no rows.
    The database has stored dates in the form DD-MM-YYYY HH:MM:SS AM|PM, but the query string contains a date in the form YYYY-MM-DD.
    What do I need to do to make Oracle recognise the two formats as being the same?
    Do I need to tell BC4J what date format to use?
    Is there a class I can use to format an oracle.jbo.domain.Date object into a format that the RowQualifier can understand?
    Do I need to use the java DateFormatter to explicitly set the format of the Date before I add it to the where clause?

    >>Jan 1 2014 12:00:00:000AM
    I am not sure(I am also not so good in Zend,but still would like to give it a shot), should the format be like this?
    Jan 1 2014 12:00:00.000 AM
    Also SQL stores the date in the format YYYY-MM-DD hh:mm:ss.fff(2014-02-12 21:41:00.293). So I think, if you pass the date in that format your query would work fine
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • How to pass date parameter in URL in system date format

    Hi All,
    I am working on a requirement where I need to pass the date parameter in URL. Where date format needs to be system default date format. How can we format date without providing specific date format.
    Also, I got some post which had below example. Can you let me know what this format does.
    '/analysis/report?queryGroupName=Custom-ProjectInfo&TimePeriodBeginning=', <%+%> FCI_CHARFMT(TIME_PERIOD_START_DATE),' <%+%>
    '&TimePeriodBeginning_format=17&link_crumb=true'
    Waiting for response.
    Thanks,
    Saloni

    Hi,
    If you're running this in SQL*Plus, you can use substitution variables.
    If you have a file called my_query.sql, like this
    select    A.agent_no,
              (a.first_name || A.agent_name)     as agent_Name,
              P.Policy_No,
              D.Driver_No,
              D.mvr_predict_score,
           D.mvr_received
    from        policy  P,
           agent   A,
           Driver  D
    where       D.request_mvr_hit   = 'M'
    AND       D.mvr_predict_Score > 540
    And       D.request_mvr          = 'D'
    AND        p.fullkey           = d.fullkey
    AND       p.agent_no          = a.agent_no
    AND       d.mvr_received     >= TO_DATE ('&1', 'DD-Mon-YYYY')          -- New
    AND       d.mvr_received     <  TO_DATE ('&2', 'DD-Mon-YYYY') + 1     -- New
    order by  a.agent_no,
                 CASE  a.producer_type
               when  'S'  then 1
               when  'C'  then 2
               when  'R'  then 3
           end
    ;Then you can run it from SQL*Plus by saying something like:
    @my_query  1-Jan-2009  31-Dec-2009&1 in the script will be replace by the 1st argument (1-Jan-2009) and &2 will be replaced by the 2nd argument (31-Dec-2009).
    Notice that the last condition adds 1 to the argument
    AND       d.mvr_received     <  TO_DATE ('&2', 'DD-Mon-YYYY') + 1     -- Newbut uses the < operator (not <=). The result is that if mvr_received is any time on the last day (e.g. 31-Dec-2009 11:59 pm) will be included.

  • Date format in a parameter field (help)

    Post Author: binsk
    CA Forum: Formula
    Hi Guys,
    Newbie in CR world.
    I need help in changing the date format in parameter field. present setting is YYYY/MM/DD. I need it in DD/MM/YYYY. How is it to be done? My db is running in oracle. I'm using the CR XI version.
    Thanks ahead.
    Alex

    Post Author: Aman
    CA Forum: Crystal Reports
    Thank you for your response Yangster. 
    However, the below formula did not work, it gives me a message that "this field name is not known" {?end_date}.
    date_field in dateadd("d", -100, {?end_date}) to {?end_date}
    Am I not inputing this right? or do need a different formula/method?
    Please help...
    Thank you,

  • Formating string to date format in vc

    hai,
    function module in production return a date in type of char10. now i need to convert into proper data format.
    can any one help me.

    data: l_date type datum
          , l_d(10)
    l_date = sy-datum.
    write l_date to l_d. -> This statement will convert into user date format
    write:/ l_d.  
    ...Naddy

  • Date Format in VC

    Hi,
    We have a details table where there is particular date field which is automatically displayed as plain text. The user can edit these records by selecting the line item. The date value should be given in the Date Picker for the user to change the values if needed.
    The format in which the date field displayed as text in the table is YYYYMMDD (20101021). I need to display this field in the date format as DD.MM.YYYY. I tried using the formula something like this
    DATE(MID(@Expected_Resolution_Date,1,4),MID(@Expected_Resolution_Date,5,2),MID(@Expected_Resolution_Date,7,2)) - This will give the year, month and date fields separately.
    Only DSTR has the option of providing the format in the date function so I tried something like DSTR(DATE(MID(@Expected_Resolution_Date,1,4),MID(@Expected_Resolution_Date,5,2),MID(@Expected_Resolution_Date,7,2)) ,"DD.MM.YYYY")
    It throws me a error Expected date value/expression. Can someone help me out here? I need to convert in this date format and show it in the date picker.
    Thanks,
    Nagarajan.

    I fixed the problem by playing around with the formula editor.
    Thanks.

  • Date format in meeting request responses appears to be hardcoded to US format

    Hi
    When a room mailbox declines a meeting request that exceeds the booking window in days a response like this is returned.
    The end date of this series of repeating meetings is too far in the future. This resource can only be scheduled up to 180 days in advance. The end date
    must be before 2/7/2011.
    The date returned appears to be hardcoded in US format (M/d/yyyy). I need this to be NZ date format (d/MM/yyyy). How can I accomplish this?
    Thanks
    Olli

    FWIW, we are also having the same problem despite the room being set to the correct regional settings.  Our environment is Exchange 2010 SP2
     [PS] C:>get-mailboxregionalconfiguration  MeetingRoom | select *
     RunspaceId                            : 1657394a-5640-4d8b-9b3b-e061e03db69f
     DateFormat                            : d/MM/yyyy
     Language                              : en-AU
     DefaultFolderNameMatchingUserLanguage : False
     TimeFormat                            : h:mm tt
     TimeZone                              : AUS Eastern Standard Time
     Identity                              :
     IsValid                               : True
    The Declined message reads:
     Your meeting request was declined.
     The end date of this series of repeating meetings is too far in the future. This resource can only be scheduled up to 500 days in advance. The end date must be before 11/17/2013.
     All times listed are in the following time zone: Customized Time Zone
    I guess, given the lack of response from MS, that it is in fact hard coded and cannot be changed. C'mon MS, can you atleast confirm this is the case?
    Thanks guys
    Mick

  • How do I change the date format in Forms Central from mm/dd/yyy to dd/mm/yyy?

    I'm using Forms Central on a Mac and need to convert the US date format to the one used in Australia ie from mm/dd/yyyy to dd/mm/yyyy. I've tried Field properties and can't see any other options. Is there a quick fix somewhere?

    This is covered in the free documentation provided by Adobe for Acrobat JavaScript.
    Acrobat JavaScript documentation
    Use date objects
    Convert the date string to the date object, then use the util.printd method to reformat the date object as needed.

  • Converting daily date format to Calendar format 466

    Hi All,
    I need to convert the DAILY DATE FORMAT TO FORMAT 466...
    (4 WEEKS IN PERIOD 1,6 WEEKS IN PERIOD 2 ,6 WEEKS IN PERIOD 3,
    4 weeks in period 4,6 weeks in period 5,6 weeks in period 6)
    I'm thinking buckets. NTILE perhaps?
    But how to approach for it..???
    Anyone's help will be appreciated.
    Regards
    Saugata

    My example shows how to translate a date into what you call a "week". You'll need some fiddling to I've never heard of 466 format of weeks so it's not something that there is a pre-existing tool for. NTILE is one approach.
    This gives every day in 2008 it's correct period - it's a bit messy, but then I'm only doing it to teach myself about NTILE.
    with T as (
    select to_date('31/12/2007','DD/MM/YYYY')+level dt
           from dual connect by level <=366)
    select to_char(dt,'MM') mth, week, min(dt) start_date, max(dt) end_date from (
    select  t.dt dt, NTILE(case when mod(to_char(dt,'MM'),3) = 1 then 4 else 6 end  )
                         OVER (partition by to_char(dt,'MM') order by dt asc) week
    from t
    ) group by to_char(dt,'MM'), week
    MTH     WEEK     START_DATE     END_DATE
    01     1     01/01/2008     08/01/2008
    01     2     09/01/2008     16/01/2008
    01     3     17/01/2008     24/01/2008
    01     4     25/01/2008     31/01/2008
    02     1     01/02/2008     05/02/2008
    02     2     06/02/2008     10/02/2008
    02     3     11/02/2008     15/02/2008
    02     4     16/02/2008     20/02/2008
    02     5     21/02/2008     25/02/2008
    02     6     26/02/2008     29/02/2008
    03     1     01/03/2008     06/03/2008
    03     2     07/03/2008     11/03/2008
    03     3     12/03/2008     16/03/2008
    03     4     17/03/2008     21/03/2008
    03     5     22/03/2008     26/03/2008
    03     6     27/03/2008     31/03/2008
    04     1     01/04/2008     08/04/2008
    04     2     09/04/2008     16/04/2008
    04     3     17/04/2008     23/04/2008
    04     4     24/04/2008     30/04/2008
    ...

  • Converting date format yyyy-mm-dd to mm/dd/yyyy

    Hi,
    I need help converting the above date format. In the database the date is stored as a VARCHAR with the format yyyy-mm-dd
    but I would like it changed to DATE with the format mm/dd/yyyy. I tried the following and I keep getting invalid month
    select To_date(date_value, 'mm/dd/yyyy') as date_value from table
    When I try to convert it to char first before converting to date I get an invalid number error
    select to_date(to_char(date_value, 'mm/dd/yyyy'), 'mm/dd/yyyy') as date_value from table
    What do I do?
    Thanks for your help!!!

    Hi,
    The second argument of TO_DATE tells what format the first argument is already in.
    So you want:
    select  To_date (date_value, 'yyyy-mm-dd') as date_value
    from    table_x;Format is a quality of strings, not DATEs. Once you have converted your string to a DATE, is is stored in the same internal format as all the other DATEs. Use TO_CHAR to display it in any format you like.
    For example:
    SELECT     TO_CHAR ( TO_DATE (date_value, 'yyyy-mm-dd')
              , 'mm/dd/yyyy'
    FROM     table_x;Things are much easier if you store dates in DATE columns.

Maybe you are looking for