Date format in MVIEW
Hi All,
I have creted the snapshot as
CREATE SNAPSHOT EMPLOYEE_CRIS_MVIEW
PCTFREE 10
PCTUSED 40
MAXTRANS 255
TABLESPACE users
STORAGE (
INITIAL 40960
NEXT 73728
PCTINCREASE 1
MINEXTENTS 1
MAXEXTENTS 505
BUILD IMMEDIATE
REFRESH ON DEMAND
With rowid
AS
select
emp_id,
join_dt,
emp_stat,
from employee_CRIS
The date format for the column join_dt is dd-mon-yyyy.
But I want to modify the date format for this column as 'MM/DD/YYYY'.
For that I tried
ALTER snapshot EMPLOYEE_CRIS_MVIEW modify(TO_CHAR(join_dt,'MM/DD/YYYY'));
But I got the error
ERROR at line 1:
ORA-00902: invalid datatype
Could you please help me to change the change the date format of the column of the snapshot
with out dropping the snapshot.
Please help me.
Thanks in advance.
What people are saying is that date columns (of DATE datatype) are stored internally using a fixed internal notation, which is essentially a series of bytes that describe the date.
e.g.
SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
EMPNO ENAME HIREDATE DUMP_HIREDATE
7369 SMITH 17/12/1980 00:00:00 Typ=12 Len=7: 119,180,12,17,1,1,1
7499 ALLEN 20/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,20,1,1,1
7521 WARD 22/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,22,1,1,1
7566 JONES 02/04/1981 00:00:00 Typ=12 Len=7: 119,181,4,2,1,1,1
7654 MARTIN 28/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,28,1,1,1
7698 BLAKE 01/05/1981 00:00:00 Typ=12 Len=7: 119,181,5,1,1,1,1
7782 CLARK 09/06/1981 00:00:00 Typ=12 Len=7: 119,181,6,9,1,1,1
7788 SCOTT 19/04/1987 00:00:00 Typ=12 Len=7: 119,187,4,19,1,1,1
7839 KING 17/11/1981 00:00:00 Typ=12 Len=7: 119,181,11,17,1,1,1
7844 TURNER 08/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,8,1,1,1
7876 ADAMS 23/05/1987 00:00:00 Typ=12 Len=7: 119,187,5,23,1,1,1
7900 JAMES 03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
7902 FORD 03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
7934 MILLER 23/01/1982 00:00:00 Typ=12 Len=7: 119,182,1,23,1,1,1
14 rows selected.Here, you can see from the dumped dates that they are all stored as 7 bytes of data, which sort of resemble the date you see on the screen in some way, but not quite. It's an internal format that Oracle understands and uses, and it's important it's stored in this way so that date arithmetic and date range comparisons can be performed easily (and quickly) in queries.
If we were to alter our sessions date format (the display format for our session only) and query the data again in the same way...
SQL> alter session set nls_date_format='YYYY-MM-DD';
Session altered.
SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
EMPNO ENAME HIREDATE DUMP_HIREDATE
7369 SMITH 1980-12-17 Typ=12 Len=7: 119,180,12,17,1,1,1
7499 ALLEN 1981-02-20 Typ=12 Len=7: 119,181,2,20,1,1,1
7521 WARD 1981-02-22 Typ=12 Len=7: 119,181,2,22,1,1,1
7566 JONES 1981-04-02 Typ=12 Len=7: 119,181,4,2,1,1,1
7654 MARTIN 1981-09-28 Typ=12 Len=7: 119,181,9,28,1,1,1
7698 BLAKE 1981-05-01 Typ=12 Len=7: 119,181,5,1,1,1,1
7782 CLARK 1981-06-09 Typ=12 Len=7: 119,181,6,9,1,1,1
7788 SCOTT 1987-04-19 Typ=12 Len=7: 119,187,4,19,1,1,1
7839 KING 1981-11-17 Typ=12 Len=7: 119,181,11,17,1,1,1
7844 TURNER 1981-09-08 Typ=12 Len=7: 119,181,9,8,1,1,1
7876 ADAMS 1987-05-23 Typ=12 Len=7: 119,187,5,23,1,1,1
7900 JAMES 1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
7902 FORD 1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
7934 MILLER 1982-01-23 Typ=12 Len=7: 119,182,1,23,1,1,1
14 rows selected.... whilst the hiredate is now showing on the screen in the format we've chosen, the actual internal storage of those dates remains completely unchanged. i.e. we don't have to change the format of the internal storage of dates to make them display differently.
Likewise you can format dates manually as part of your query using to_char function...
SQL> select empno, ename, to_char(hiredate,'DD Month YYYY') as hiredate, dump(hiredate) as dump_hiredate from emp;
EMPNO ENAME HIREDATE DUMP_HIREDATE
7369 SMITH 17 December 1980 Typ=12 Len=7: 119,180,12,17,1,1,1
7499 ALLEN 20 February 1981 Typ=12 Len=7: 119,181,2,20,1,1,1
7521 WARD 22 February 1981 Typ=12 Len=7: 119,181,2,22,1,1,1
7566 JONES 02 April 1981 Typ=12 Len=7: 119,181,4,2,1,1,1
7654 MARTIN 28 September 1981 Typ=12 Len=7: 119,181,9,28,1,1,1
7698 BLAKE 01 May 1981 Typ=12 Len=7: 119,181,5,1,1,1,1
7782 CLARK 09 June 1981 Typ=12 Len=7: 119,181,6,9,1,1,1
7788 SCOTT 19 April 1987 Typ=12 Len=7: 119,187,4,19,1,1,1
7839 KING 17 November 1981 Typ=12 Len=7: 119,181,11,17,1,1,1
7844 TURNER 08 September 1981 Typ=12 Len=7: 119,181,9,8,1,1,1
7876 ADAMS 23 May 1987 Typ=12 Len=7: 119,187,5,23,1,1,1
7900 JAMES 03 December 1981 Typ=12 Len=7: 119,181,12,3,1,1,1
7902 FORD 03 December 1981 Typ=12 Len=7: 119,181,12,3,1,1,1
7934 MILLER 23 January 1982 Typ=12 Len=7: 119,182,1,23,1,1,1
14 rows selected.
SQL>Again, the internal date format remains the same.
It is important that, when you store date information you store it as DATE datatype and let oracle use it's internal format, so that it can accurately do the date arithmetic, date range searches and date ordering etc., that everyone likes to do in queries. If you try and store it as VARCHAR2 then not only can information be lost (i.e. is '01/02/2010' representing 1st February 2010 or is it 2nd January 2010?) but you prevent date arithmetic, range searches and ordering in your queries from working correctly (i.e. '03/01/2009' would work out to be a greater date than '01/02/2010'). To prove it...
SQL> select 'Wrong' from dual where '03/01/2009' > '01/02/2010';
'WRON
Wrong
SQL> ed
Wrote file afiedt.buf
1* select 'Wrong' from dual where to_date('03/01/2009','DD/MM/YYYY') > to_date('01/02/2010','DD/MM/YYYY')
SQL> /
no rows selected
Similar Messages
-
Hi Tim,
I am facing some issues with formatting the date using XMLP. The following is the sample XML data file i am using:
<LIST_G_HEADER>
<G_HEADER>
<QUOTE_HEADER_ID>1455</QUOTE_HEADER_ID>
<QUOTE_NUMBER>2027</QUOTE_NUMBER>
<QUOTE_VERSION>1</QUOTE_VERSION>
<QUOTE_NAME>Test GM Report - Rabindra</QUOTE_NAME>
<SOURCE_NAME>Fletcher, MR. Paul</SOURCE_NAME>
<QUOTE_DATE>27-OCT-2005</QUOTE_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
</G_HEADER>
</LIST_G_HEADER>
The formatting i use for my date field i.e <QUOTE_DATE>, ends up either with NO formatting or giving me an error "[010906_114656657][][ERROR] Invalid XSD string: 27-OCT-2005 (XMLP Template Viewer)". The default formatting available with the form field dialog box (MS-Word) feature also doesn't work.
I have the following formatting for this field in the form field:
<?format-date:QUOTE_DATE; 'MEDIUM' ?>
When i read the user guide, it reads that the date should be in the canonical format i.e: YYY-MM-DDThh:mm:ss+HH:MM
However i am not getting the date from the base table's in this format. Is the error happening due to incorrect format or is there some other reason behind this? Please let me know, how can i overcome this issue.
Thx,
NitinAs i mentioned in another thread
substring function and date format
Please use this standards
<?xdofx:expression?>
for extended SQL functions or
<?xdoxslt:expression?>
for extended XSL functions.
Use like
<?xdofx:rpad(LAST_NAME),30, ’x’)?>
<?xdofx:Instr(’abcabcabc’,’a’,2))?>
<?xdofx:upper(char)?>
<?xdofx:lower (char)?>
<?xdofx:greatest ( expr [, expr]... )?>
ETC..... -
How can we give the Data Format (File Type ) in Runtime
Hi all,
How can we give the Data Format (File Type ) in Runtime for the following method,
cl_gui_frontend_services=>gui_download.
Thanks in advance
SriThere is a filetype parameter which you can set
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
* BIN_FILESIZE =
filename =
* FILETYPE = 'ASC'
* APPEND = SPACE
* WRITE_FIELD_SEPARATOR = SPACE
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = SPACE
* WRITE_LF = 'X'
* COL_SELECT = SPACE
* COL_SELECT_MASK = SPACE
* DAT_MODE = SPACE
* CONFIRM_OVERWRITE = SPACE
* NO_AUTH_CHECK = SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = SPACE
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* IMPORTING
* FILELENGTH =
changing
data_tab =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* NOT_SUPPORTED_BY_GUI = 22
* ERROR_NO_GUI = 23
* others = 24 -
Need to convert into date format
Hi all,
I need to convert '2008-11-26T11:07:38-06:00' [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS][TIMEZONE]
in format 'YYYY-MM-DD HH:MM:SS'.
Thanks in advance.>
Thank you for your reply
But it is giving me output as '26-NOV-08'
And I want in format '2008-11-26 07:38' i.e 'YYYY-MM-DD HH:MM'.
>
Then you are not looking for a date, You are looking for a string.
The date format that gets displayed is dependent on nls_date_format parameter.
If you want a string in the format you asked, then,
SELECT TO_CHAR ( TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"'), 'YYYY-MM-DD HH24:MM:SS')
FROM DUAL;Or if you just want the date to be displayed like that then
Do,
SQL> alter session set nls_date_Format="YYYY-MM-DD HH24:MI:SS";
Session altered.
SQL> SELECT TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"') dt
2 FROM DUAL;
DT
2008-11-26 11:07:38
SQL> G. -
Changing date format at reporting level
Hello,
Will u plz tell me how can i change the date format at reporting level?
I want to display date in dd/mm/yyyy, but by default its showing mm/dd/yyyy.
Delta is already loaded in the system, so i don't want to disturb regular data loading.
Is there any way so that i can change the format of date.
Plz help me out.
Thanks,
Regards,
SteveHi steve
There r so many postings on the same topic
go through these previous threads
date format
Date format
u can find solution
regards
Ravi Kiran -
How to convert the numeric to date format
HI ,
We have created the date KF and selected the data type as DEC-numeric or counter and add in the cube.
the data for this fields in the cube are in numerics like 734.504, but when we execute the report it is converted in to date format dd.mm.yyyy.
My issue how this conversion is working in the backend while executing the report.
Regards.
venkataConversion is happening because of the type you had selected for the KF while creating it.
Check the type of the Key figure?
While creating the KF you might have selected the Type as Date and Data type -DEC : Counter or amount field with comma and sign.
that's the reason why you are getting the output values displayed in dd.mm.yyyy format.
For amount field - create a KF with type "AMOUNT" and unit -0currency or specify the currency of that region.
regards
KP -
How to get Date Format from Local Object.
Hi All,
I am new to Web Channel.
I need to know Date format From date of locale.
suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC.
Is there any way to get Date format from "Locale" object. I should get date format for local object
I get local object from "UserSessionData" object but how to get Date format from it.
I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format. I could not find example which show how to get date format from "Locale" object.
Any help will be appreciated with rewards.
Regards.
Web ChannelHi,
You can get it from "User" or "Shop" business object.
Try to get User or Shop Business Object as shown below.
BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
User user = bom.getUser();
char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
If you are seeing "1,234.00" then above code will return "."
I hope this information help you to resolve your issue.
eCommerce Developer. -
How to change default Date format in BO 6.5 SP4
A problem with date display has been reported to me by one of our users - in BO 6.5 - since installing SP4.
The default date format is now MM/DD/YYYY
I have tried to recreate this on my PC and have been able to confirm that this is the case.
Most of our PC's will have two versions of Business Objects on them - for 5.1.6 and for 6.5 - that is the case for my PC.
If I create a new BO document based on a spreadsheet with three entries in the spreadsheet as follows:-
20/01/2009 20-Jan-2009 20th January 2009
This displays in BO 6.5 as
1/20/2009 1/20/2009 20th January 2009
My PC regional setting is UK and the time displays DD/MM/YYYY
Can you advise how to correct this problem please.Hi Sebastien
Thank you for your response.
I haven't checked Dimension in universe because this is happening even when datasource is an Excel spreadheet - as per details in previous post.
I have looked for *.sbo files and found one for ODBC.sbo in the Version 5 folders on PC - with date format details in it which I've changed - that doesn't make any difference.
Any other ideas?
Regards
Linda -
Date format issue in oracle database
Hi,
Back end : Oracle 11.2.0.2.0
Front end : Forms 11g
In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
The Nls_date_format parameter at database level is set as 'DD-MON-RR'
Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
pls help us to solve the issue.
Regards.
sathish k892913 wrote:
Hi,
Back end : Oracle 11.2.0.2.0
Front end : Forms 11g
In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
The Nls_date_format parameter at database level is set as 'DD-MON-RR'
Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
pls help us to solve the issue.
Regards.
sathish kWell the solution is right in front of you. As you say, your database environment is set to DD-MON-RR so your database is set to use 2 digit years (something most people moved away from with the millenium bug more than 10 years ago now). You can either change all your code to use RRRR as you've found, or change your database NLS setting to DD-MON-RRRR and change your front end application to pass you a date with 4 digit years so you get e.g. '20-dec-2009'.
So many people worked hard to resolve the millenium bug issues all those years ago, but still we have people, all these years later, who want to reintroduce the problem. So sad. -
Problem with SQL*Loader and different date formats in the same file
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
System: AIX 5.3.0.0
Hello,
I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
...;2010-12-31;22/11/1932;...
I load this data using the following lines in the control file:
EXECUTIONDATE1 TIMESTAMP NULLIF EXECUTIONDATE1=BLANKS "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
DELDOB TIMESTAMP NULLIF DELDOB=BLANKS "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
The relevant NLS parameters:
NLS_LANGUAGE=FRENCH
NLS_DATE_FORMAT=DD/MM/RR
NLS_DATE_LANGUAGE=FRENCH
If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
How can I get both date values to load correctly?
Thanks!
SylvainThis is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(
-
Problem with date format mask 'D'
I am experiencing an extremely thorny problem with the date format mask ‘D’. I am trying to use it to check whether today is a Monday. The variable v_temp_day is set to sysdate. For the last 4 weeks the code has behaved erratically – giving a different result at 02:00 than at 10:30 even though it is only taking account of the date. In desperation I inserted a debug statement formatting the date in a variety of ways – with interesting results. Oracle is somehow managing to tell us that today is simultaneously Monday and Tuesday depending on which format mask you choose. Anyone got any thoughts or suggestions?
PROC_ID TO_CHAR(STAMP_TIM
EVENT_SQLERRM
RRHKP010 17092007 02:00:00
TO_NUMBER( TO_CHAR( v_temp_day, D ) ) = 2. TO_CHAR( v_temp_day, D ) = 2. TO_CHAR( v_temp_day, DY ) = MON. TO_CHAR( v_temp_day, DAY )
= MONDAY . TO_CHAR( v_temp_day, Day DD-MON-YYYY HH24MISS ) = Monday 17-SEP-2007 020000. TO_CHAR( v_temp_day, D ) = 2.
SQL> select to_char( sysdate, 'D' ) from dual ;
T
1My book says the trunc(d,'iw') will return "same day of the week as Jan 1st of that year"It's bad book.
Please read about [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions176a.htm#80159]TRUNC & 'IW' Format Model and [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96529/ch3.htm#50331]Database Globalization Support Guide: First Calendar Week of the Year in the manual. -
Problem with date format when ask prompt web-intelligence
Bo XIR2 with 5 SP. Instaled on Windows 2003 with support Russian.
Inside BO every labels, buttons - use russian. But when invoke web-report and Prompt appear there is problem with date format.
Looks like korean format of date 'jj.nn.aaa H:mm:ss'. I see system settings of date in Win .. everything right
What i have to do?
Where i can change format date for bo?GK, try this...
decode(instr(packagename.functionname(param1 ,param2),'2400'), 0, to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" hh24mi'),'mm/dd/yyyy hh24mi'),'mm/dd/yyyy hh24mi'),
to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" "2400"')+1,'mm/dd/yyyy "0000"'),'mm/dd/yyyy "0000"'))-Marilyn -
Got one more problem Merilyn and Radhakrishnan...
Regarding the soln y provided me earler with the thread "Problem with date format"...
What is happening is....I am able to change the 2400 to 0000 but when it is changed from 2400 on jan 1st to 0000 the hour is changing but not the date....the date still remains as jan 1st instead of jan 2nd....
Eg: Jan 1st 2400 -- changed to -- jan1st 0000
instead of jan 2nd 0000
Could you please help me in this issue...
Thanks,
GKGK, try this...
decode(instr(packagename.functionname(param1 ,param2),'2400'), 0, to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" hh24mi'),'mm/dd/yyyy hh24mi'),'mm/dd/yyyy hh24mi'),
to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" "2400"')+1,'mm/dd/yyyy "0000"'),'mm/dd/yyyy "0000"'))-Marilyn -
Problem with date format from Oracle DB
Hi,
I am facing a problem with date fields from Oracle DB sources. The date format of the field in DB table is 'Date base type is DATE and DDIC type is DATS'.
I mapped the date fields to Date characters in BI. Now the data that comes to PSA is in weird format. It shows like -0.PR.09-A
I have changing the field settings in DataSource to internal and external and also i have tried mapping these date fields to text fields with out luck. All delivers the same format.
I have also tried using conversion routines like, CONVERSION_EXIT_IDATE_INPUT to change format. It also delivers me the same old result.
If anybody of you have any suggestions or if anybody have you experienced such probelms, Please share your experience with me.
Thanks in advance.
Regards
VaradaThanks for all your reply. I can only the solutions creating view in database. I want some solution to be done in BI. I appreciate if some of you have idea in it.
The issue again in detail
I am facing an issue with date fields from oracle data. The data that is sent from Oracle is in the format is -0.AR.04-M. I am able to convert this date in BI with conversion routine in BI into format 04-MAR-0.
The problem is, I am getting data of length 10 (Output format) in the format -0.AR.04-M where the month is not in numericals. Since it is in text it is taking one character spacing more.
I have tried in different ways to convert and increased the length in BI, the result is same. I am wondering if we can change the date format in database.
I am in puzzle with the this date format. I have checked other Oracle DB connections data for date fields in BI, they get data in the format 20.081.031 which will allow to convert this in BI. Only from the system i am trying creating a problem.
Regards
Varada -
Problem with date format dd/mm/yyyy. But I need to convert yyyy-mm-dd.
Dear friends,
I have the problem with date format. I receiving the date with the format dd/mm/yyyy. But I can upload to MySQL only in the format of yyyy-mm-dd.
how should I handle this situation, for this I've created these code lines.But I have some problem with these line. please help me to solve this problem.
String pattern = "yyyy-mm-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("2006-02-12");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I need the date format in yyyy-mm-dd.
regards,
maza
thanks in advance.Thanks Dear BalusC,
I tried with this,
rs.getString("DATA_SCAD1")// where the source from .xls files
String pattern = "yyyy-MM-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("DATA_SCAD1");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I want to display the date format in yyyy-mm-dd.
regards,
maza
Maybe you are looking for
-
Some of my rotation animation is stepping at about one degree increments instead of tweening smoothly. I'm using classic tweening. I see that if I select the whole interval and use F6 to convert every tween frame to a key and then select the object
-
Grouping data for specific requirement
Despite my initial efforts, I have been unable to solve a problem with a report written in SQL. The data I have is as follows: Territory Name Order # Description Qty Order total OKMGAS008 James Coo
-
How to display russian from a an html file created in textedit?
I have created an html page in textedit which contains some russian text, how can i get safari to display this text properly?? In my textedit i used plain text but for some reason it comes out all starange in safari....
-
"The User profile Service service failed at the logon. User profile cannot be loaded".
Hi I'm having the below problem while i'm starting to logon to my system. when i entered the password, i'm getting the below msg as "The User profile Service service failed at the logon. User profile cannot be loaded." i m trying since morning .
-
Where to keep the Originals?
When I moved my photos from PC to Mac, I organized them into folders. Most of them are by the year, and others are by different subjects. I put them on the desktop and then moved them one by one creating albums. So, if the folder was 2005, it became