How to change the date time format in jsp

Hello Sir,
I am trying to convert the date from one format into another format.
In SQLServer one fields type as datetime.
when i tried to display it in jsp with String variable it shown like below,
2006-08-16 09:11:23.0
how to format this value as
Wed, Aug 16, 2006 09:11 AM
my code is
java.text.SimpleDateFormat fmt= new java.text.SimpleDateFormat("EEE, MMM d, yyyy K:mm a ");
fmt.format(string value fetch from dtabase field);
Plz provide me the solution asap. very urgent request.
Regards
venki.

Hello Sir,
I am trying to convert the date from one format into
another format.
In SQLServer one fields type as datetime.
when i tried to display it in jsp with String
variable it shown like below,
2006-08-16 09:11:23.0
how to format this value as
Wed, Aug 16, 2006 09:11 AM
my code is
java.text.SimpleDateFormat fmt= new
java.text.SimpleDateFormat("EEE, MMM d, yyyy K:mm a
fmt.format(string value fetch from dtabase field);
Plz provide me the solution asap. very urgent
request.
Regards
venki.Have a look in to the below code
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateFormatTest
public static void main( String[] cmdArgs )
throws Exception
SimpleDateFormat sdfInput =
new SimpleDateFormat( "yyyy-MM-dd" );
SimpleDateFormat sdfOutput =
new SimpleDateFormat ( "EEE, d MMM yyyy hh:mm aaa" ); //Change the patterns in to what ever u need
String textDate = "2001-01-04";
Date date = sdfInput.parse( textDate );
System.out.println( sdfOutput.format( date ) );
i will suggest u to look in to the API doc you will come to know lot many things.

Similar Messages

  • How to get the date time format in OCI

    How to get a date time format in OCI instead of only date

    You would have to use the OCIDateTime datatype for this. Refer to
    OCI documentation for more details.

  • How to change the date/time

    Now I chang the CMLocal date/time group and apply it to Device pool for phone, but I find the date/time displayed on phone is wrong ?why?

    I have the same problem with CCM 4.1(3)SR3 and Cisco IP Phone 7970.
    Can you help me please?

  • How To change the Date display format to dd.mm.yyyy format

    Hello friends
    I am expected to display the date fields in my BEx reports in the standard dd/mm/yy format. However, I find that it is getting displayed in mm/dd/yyyy form.
    This is creating a bit of a confusion for the client.
    Hence can someone please let me know, if I can make any change to the way the date is displayed in the reports.
    Looking for a prompt reply
    Thanks in advance
    regards
    Zubin Kurian

    Hi Zubin,
            There are some corrections in that coding.
    year = year+2(2).
    CONCATENATE day month year INTO l_date SEPERATED BY u2018/u2019.
    Regards,
    Yokesh.

  • How to change the date and time during OVM installation for Fusion Apps

    Hi,
    The customer is using Fusion Instance which is a V1 (Build 19) OVM installation shipped by Oracle with Demo Data (including seeded user IDs and roles) in it.
    Now they have issue with Date format for the application on the screens is showing MM/DD/YYYY where as it should be (Singapore) Standard is DD/MM/YYYY.
    Q/A: How to change the date/time in OVM image
    Refer SR : 3-5640792461
    Regards
    Ganesh Ananthapadmanaban

    Not a problem. There are a number of other system and network setup commands that you might find useful at some time. From within the Remote Desktop Admin in the Send Unix Command window type:
    networksetup -help
    systemsetup -help
    That will give you lists of the commands, including the one I posted above, with their basic syntax. They're handy to know.
    Cheers.

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

  • How to change the date format  YYYYMMDD to MM/DD/YYYY

    Hi ,
    How to change the date format  YYYYMMDD to MM/DD/YYYY .
    Ex :  20071008  to 10/08/2007
    Is there any function module for this ??
    Regards
    Rahul

    Hi Sharma,
    check the code:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
    date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
    date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
    date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
    date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
    SELECT mnr
    ktx
    ltx
    INTO TABLE T_month
    FROM t247
    WHERE spras = 'EN'.
    IF sy-subrc NE '0'.
    MESSAGE I "Message - Not able to get month values from the table T247
    ENDIF.
    ENDFORM.
    DATA : temp_date(16) TYPE c,
    temp1_date(60) TYPE c,
    year(4) TYPE c,
    daymonth(11) TYPE c,
    daymonth1(11) TYPE c,
    month(9) TYPE c,
    day(2) TYPE c,
    mon LIKE t247-ktx,
    len TYPE i .
    MOVE date TO temp1_date .
    CONDENSE temp1_date NO-GAPS.
    MOVE temp1_date TO temp_date .
    IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    _len = STRLEN( _daymonth1 ).
    l_len = 13 - len.
    SHIFT daymonth1 RIGHT BY len PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    SORT t_month BY monthltx.
    READ TABLE t_month WITH KEY monthltx = month.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    len = STRLEN( month ).
    CONDENSE daymonth NO-GAPS.
    SHIFT daymonth LEFT BY len PLACES.
    day = daymonth.
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT i_date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    SHIFT daymonth1 LEFT BY 2 PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    TRANSLATE month TO UPPER CASE.
    SORT t_month BY monthstx.
    MOVE month to mon.
    READ TABLE t_month WITH KEY monthstx = mon.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    CONDENSE daymonth NO-GAPS.
    day = daymonth+0(2).
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
    CONDENSE temp_date NO-GAPS.
    IF STRLEN( temp_date ) EQ 10.
    o_date0(4) = temp_date6(4).
    o_date4(2) = temp_date3(2).
    o_date6(2) = temp_date0(2).
    ELSE.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM. " f0100_conv_date
    Reward if helpful.
    Regards,
    Harini.S

  • How to display the Date Time using the System Time zone

    Friends,
    Can anyone help me with below scenario..
    I have to display Date Time on a jsff page, This value associated to one of Transient View object populated from the database.. Is there any way I can handle on the screen to display the same date /time bassed on the system time zone ?
    I know one way how we can handle it.. while populating to View object we can set the time based on the system time zone.. but it would be easy and simple if there is any approach I can use on UI layer itself..
    thanks

    I don't understand why this display doesn't pay attention to the date/time format settings that are set in the language and text prefs.
    Those settings are used for date OR time, and provide for different displays depending on the space available. The menu bar does not have a fixed space available, and wants both date and time.
    In Leopard, it used the medium time format. To get the date and time, you could modify that format to include the date, but that could cause problems with software that happened to use the medium time format and expectede just the time. Also, you might want to change the medium time format without changing the menu bar display. For these reasons, Snow Leopard's menu bar clock uses its own formatting for data and time display.

  • How to change the system time in (E-Business Suite)

    Hi,
    I need to change the system timings in E-Business Suite.
    My Database & Application is on different nodes..
    How could i change system timings on both...
    Thanks,
    Alig

    Alig,
    Changing the OS date/time will have no impact on the data (except for the scheduled jobs at the database and the OS levels). As mentioned in the threads I referenced above, you have to stop the application/database, change the date/time at the OS level, and start the application.
    The application is just an interface which connects to the database, so it gets all the data from the database server. However, if you want to change the date/time it has to be done on both nodes (stop all the services first as mentioned above).
    Btw, what is the point of changing the date/time because of Ramadan? The business requirement of your client does not make sense (how does it differ from the application/database perspective if you start working at 9:00 AM instead of 7:00 AM for example)?
    The steps in the document should be enough, and if you do not trust any of the replies here you could simply log a SR and confirm this with Oracle support.
    Thanks,
    Hussein

  • How to change the default time?

    when you finish the action of dialing ,the CCM system recognize your finish after 10s .How to change the default time in Service Parameters ,which is the detail Parameters ?

    Please see the following link for information on configuring the interdigit timeout.
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_tech_note09186a00800dab26.shtml
    Hope this helps. If so, please rate the post.
    Brandon

  • How to change the Data sources after deploying the application ??

    Hi All,
    i want to know how to change the Data sources after deploying the application to the application server ???
    I'm using Oracle Application Server 10g Release 3 (10.1.3.1.0)

    Can you access the Enrprise Manager website of the target Application Server from your location? If so, you can change the datasource in it. If not, yo can bundle the datasource definition in your archive and use that one instead of the one configured in the target OC4J container. Or this will just be the responsability of your customer: whenever you send a new WAR file, they have to modify the datasource if needed and deploy the application?

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • Apple Remote Desktop - how to change the date and time server ip address?

    Our imacs keep getting out of synch with our Windows Active Directory server and when they do, users can no longer log into the imacs. The imacs this morning were more than 5 minutes fast, for example.
    So, we have changed the date and time server on one of our imacs to our internal time server and that works fine. Now I would like to update all of the other imacs using a unix command in ARD. Can anyone tell me how to send this change? For this message, let's say our internal time server is 172.30.100.100

    Not a problem. There are a number of other system and network setup commands that you might find useful at some time. From within the Remote Desktop Admin in the Send Unix Command window type:
    networksetup -help
    systemsetup -help
    That will give you lists of the commands, including the one I posted above, with their basic syntax. They're handy to know.
    Cheers.

  • How do I change the date/time of a dll created in LabVIEW without killing it

    I use the LabVIEW (6.0.2 of course) Application builder to create a dll, and I cannot enter creation information, nor can I modify the date time property, which labVIEW does not properly set. I have tried to modify this information in Visual C++, but that destroys the dll because it wasn't compiled in VC++, and therefore isn't compatible.
    If anyone knows how to correctly modify the date/time (and the checksum) without destroying the dll, I would be gratefull to know.
    Thank you

    Dear Sir,
    I was browsing through MSDN in trying to find the info you are looking for and I step into this next file:
    "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format"
    Which you can locate in the msdn.microsoft.com page by going to the search box and typing that title. The first result is that document. Also you may want to check the "imagehlp" file of the msdn library. This documents provides information on the DLL standard and functions.
    Good luck!...
    Nestor Sanchez
    Applications Engineer
    National Instruments
    Nestor
    National Instruments

Maybe you are looking for

  • How can I send a PDF file via my yahoo or google email programs?

    I just downloaded some photos from a friend's camera, & I want to send copies via email. I created a PDF file, but can't figure out how to email the file out (it only offers to send via Windows Mail-which I don't have). Do I need to create a differen

  • Bridge Table between two fact tables

    Hello everybody, From what I have read on the BI Administration tool help and on this forum, bridge tables are used to define many-to-many relations between dimension sand fact tables. Is it possible to have a bridge table defining a many-to-many rel

  • External .swf runtime linkage .pngs AS3

    Flash can compress .png files like Photoshop can compress .jpg files better than any other tool hands down. I have 77 .png files that are 1.8 .megs on my c: drive after I imported them and setting the file compression under the "File > Publish Settin

  • Queries regarding Bex

    1)Could anyone give any tips how to change the format of Calday from sap standard format MM/DD/YYYY to DD/MM/YYYY. Plz suggest us whether it is possible if it is possible where can the settings be set up. 2)How can we hide Header and Freecharacterist

  • Serious Adobe AIR Platform problem

    I have a Mac OS 10.6 and created an air file with database, which works perfectly on my mac. I sent the whole file folder to a friend for him to test. He has Windows XP. When he tests the file test movie for example nothing happens, not even a trace