Need datetime in this format "Tue, 5 Feb 2008 15:31:20 +0100"

Hi,
i have to export Date and Time to a string in this format:
"Tue, 5 Feb 2008 15:31:20 +0100"
DayByName, DayByNumber Month Year HH:MM:SS Timezone
Thanks for help.

Ok, i did it like you told me.
* Get Day by number
  CASE sy-fdayw.
    WHEN 1.
      v_day = 'Mon'.
    WHEN 2.
      v_day = 'Tue'.
    WHEN 3.
      v_day = 'Wed'.
    WHEN 4.
      v_day = 'Thu'.
    WHEN 5.
      v_day = 'Fri'.
    WHEN 6.
      v_day = 'Sat'.
    WHEN 7.
      v_day = 'Sun'.
  ENDCASE.
* Get Name of month
  CASE sy-datum+4(2).
    WHEN 01.
      v_month = 'Jan'.
    WHEN 02.
      v_month = 'Feb'.
    WHEN 03.
      v_month = 'Mar'.
    WHEN 04.
      v_month = 'Apr'.
    WHEN 05.
      v_month = 'May'.
    WHEN 06.
      v_month = 'Jun'.
    WHEN 07.
      v_month = 'Jul'.
    WHEN 08.
      v_month = 'Aug'.
    WHEN 09.
      v_month = 'Sep'.
    WHEN 10.
      v_month = 'Oct'.
    WHEN 11.
      v_month = 'Nov'.
    WHEN 12.
      v_month = 'Dec'.
  ENDCASE.
* Build Date, Time string in RSS-valid format
  CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
    IMPORTING
      timezone = v_tzone.
  CONCATENATE v_day ', ' sy-datum+6(2) ' ' v_month ' '
  sy-datum+0(4) ' ' sy-uzeit(2) ':' sy-uzeit+2(2) ':' sy-uzeit+4(2) ' +'
  v_tzone INTO l_datetime RESPECTING BLANKS.
My result is "Mon, 11 Feb 2008 12:36:41 +CET" but i wan't "Mon, 11 Feb 2008 12:36:41 +0100".
Maybe i need something like UTC with deviation?! UTC+1 for example and resolve numeric expression of it?
Thanks,
Stefan
Edited by: Stefan Becker on Feb 11, 2008 12:40 PM

Similar Messages

  • Creating datetime in XML format from ABAP

    Hello All:
         I have a ABAP program that creates an XML file and everything is fine. I just need one date field in XML to conform to W3CC standard (EX: 2006-12-01T10:53:05.2170000). I need datetime in the format "2006-12-01T10:53:05.2170000". How do I acheive this in ABAP?
    Thanks.
    Mithun

    That seems to be easy:
    DATA:
      lv_timestamp  TYPE timestampl,
      lv_xml_date   TYPE string.
    GET TIME STAMP FIELD lv_timestamp.
    CONCATENATE lv_timestamp+0(4)
                lv_timestamp+4(2)
                lv_timestamp+6(2)
      INTO lv_xml_date
      SEPARATED BY '-'.
    CONCATENATE lv_xml_date
                'T'
      INTO lv_xml_date.
    CONCATENATE lv_timestamp+8(2)
                lv_timestamp+10(2)
                lv_timestamp+12(2)
      INTO lv_xml_date+12(8)
      SEPARATED by ':'.
    CONCATENATE lv_xml_date
                lv_timestamp+5(7)
      INTO lv_timestamp
      SEPARATED BY '.'.
    Reward points, if reply is applicable
    Edited by: Mike Schernbeck on Jan 30, 2008 9:24 PM

  • How can i get Date in this format - 04/Feb/2008

    I need to get the date in this format - 04.Feb/2008. How can i get it using Java coding..
    java.sql.date
    Please reply to this..

    Hi,
    Are you running this code in a java file which is running on your local system???
    Is this is webapp/webdynpro???
    If this is a web app/webdynpro and if its deployed on the server, it should take the time of the system(server) where the app is deployed.
    Regards
    Ayyapparaj

  • HT3275 I need to use a Western Digital external drive on both my Mac and a PC.  To do this I need to format the drive in FAT 32.  However, Time Machine won't recognize this format.  Is there a work-around?

    I need to use my external drive on my Mac and a PC, so I formatted it in FAT 32.  I found that Time Machine doesn't recognize this format and cannot back up to it.  So, if I want to use Time Machine I need to go back to a Mac format.  Is there any way to get Time Machine to save onto a FAT 32 formatted drive?

    It's usually not a good idea to use a Time Machine drive for anything else. It's too easy to make mistakes, or not do regular backups, or run out of space.  See Time Machine - Frequently Asked Questions #1 and 3.
    But you can create a second partition on the drive, for use with Windoze.
    See #5 in the FAQ for formatting instructions.  You'll need to select 2 partitions.  It's usually best to put the Time Machine partition first, and it should have the Mac OS Extended (Journaled) Format.  Make the second one MS-DOS (FAT), although you might prefer ExFAT.
    Be sure to specify the GUID Partition table.

  • I'm having a problem saving a pages document as another format, like a Word document or PDF file.  I've never had this problem in the past.  Please help me!  I need to have this fixed a.s.a.p.

    Hello everyone,
    I'm currently having a problem saving a Pages document as another format, such as a Word document or PDF file.  I've never had this problem before with Pages.  Please help me!  I need to have this completed a.s.a.p.
    Thanks,
    Amy

    To save as a PDF, you do that from Print
    To save as Wrod format, you export
    Allan

  • I've imported a giant cd collection for my work in wav format for the best quality audio using iTunes version 11.1.1.  I need to transfer this library to our Music workstation using iTunes 11.0.1.  That workstation version of iTunes can't be upgraded for

    I've imported a giant cd collection for my boss in wav format for the best quality audio using iTunes version 11.1.1.  I need to transfer this library to our Music workstation using iTunes 11.0.1.  That workstation version of iTunes can't be upgraded for compatability reasons with other software using iTunes.  When I try to transfer the library I lose all of the CD metadata and end up with only track names.  Is there a way to transfer everything along with the metadata?

    Not easily.  WAV format does not store tag information in the file.  Realize both AIFF (equivalent to WAV) and Apple Lossless (full quality but smaller files) do, so WAV was unfortunately the worst format to chose.
    If you have to go with what you have you will have to explore exporting the library as .xml, moving it and the files to the other computer, then rebuilding a lower version library with the two sets.  I am not sure if you can do it with the library.xml file that already exists or if it too differs according to version.  You may end up having to export the files as a playlist.  You will, of course, lose artwork too, though you can try fetching it from the iTunes Store later.
    Some of what you need to do is outlined in these articles though you have the added limitation that you are not building a library of the same version.  (It really is a piity you choose WAV, otherwise you could have simply added the ripped files and most of the data would have traveled with them.)
    https://discussions.apple.com/message/20401436 - turingtest2 11/2012 post on rebuilding empty/corrupt library after upgrade/crash from previous iTunes library file.
    iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451

  • Date format - need this format --  04/04/2002 - need help?

    Hi, I am trying to get the date into this format 04/04/2002, so I can insert into the database...
    I have this code.. but it display it like this - Apr 4, 2002
    Date t = new Date();
    String today = DateFormat.getDateInstance().format(t)
    Thx
    Rich

    Or because today is the 4th day of the 4th month maybe :
    java.util.Date t = new java.util.Date();
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("MM/dd/yyyy");
    System.out.println(df.format(t));

  • Need help to convert this format of string in a int value?

    public static int isNumber( String number, int defaultValue ) {
              int result;
              try {
                   result = Integer.parseInt(number);
              } catch( Exception e ) {
                   result = defaultValue;
              return result;
         }Hi, I have the above method that converts a string Number into a int value. It works fine if the string is a normal number 234 (without spaces) but I have a string in the following format:
    *(space)�23,000(space).*
    That is I have a "space" then a "Pound" sign then two numbers then a comma followed by three numbers and then a space again.
    Is there any way I can convert this format into a simple int value?
    Thanks for any guidance.
    Zub

    Hi, I tried the following code but it don't seem to work
         public static int isNumberTrimSpaces( String number, int defaultValue ) {
              number.trim();
              String parsed = "";
              for (int i = 0 ; i < number.length() && number.charAt(i) != ',' ; i++)
             if (Character.isDigit(number.charAt(i))) {
             parsed += number.charAt(i);}
              int result;
              try {
                   result = Integer.parseInt(number);
              } catch( Exception e ) {
                   result = defaultValue;
              return result;
         }Any Ideas? Also will the loop get rid of the pound sign?

  • Why do I need to catch this exception?

    Hello all
    This is a question about exception handling. I have to build a diary application that lets you save reminders on particular dates using xml. Just to make it a little tougher, I was not allowed to use the Calendar class. This is the code I wrote:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.text.*; 
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import java.io.*;     
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;                                                                                                                                                                                                                         
    import static java.lang.Math.*;
    public class CalendarAssignment extends JFrame implements ActionListener
         int MonthLength [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
         public JButton [] days = new JButton[43];
         private JLabel lbl, reminderlbl;
         private JPanel top, grid, remindercenter, reminderbottom;
         private JFrame reminderframe;
         private JTextField year1, reminderinput, dayno;
         private JComboBox months;
         private Container container;
         private JButton fetch, save, cancel;
         private Document doc;
         private File file;
         private Node node;
         private String year, month, day;
              public static void main( String[] args ) {
                   CalendarAssignment c = new CalendarAssignment( );
                   c.setSize( 400, 300 );
                   c.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                   c.show( );
              public CalendarAssignment( ) {
                   int CurrentYear, CurrentMonth;
                   String YearString, MonthString, Now;
                   Date today;
                   container = getContentPane( );
                   container.setLayout( new BorderLayout( ) );
                   SimpleDateFormat DateFormatter;
                   DateFormatter = new SimpleDateFormat( "MM.yyyy" );
                   today = new Date( );
                   Now = DateFormatter.format( today );
                   MonthString = Now.substring( 0,2 );
                   YearString = Now.substring( 3,7 );
                   CurrentMonth = Integer.valueOf( MonthString );
                   CurrentYear = Integer.valueOf( YearString );
                   top = new JPanel( );
                        String [] items = { "January", "February", "March", "April", "May", "June",
                                      "July", "August", "September", "October", "November",
                                      "December" };
                        months = new JComboBox( items );
                        months.setEditable( false );
                        months.setSelectedIndex( CurrentMonth - 1 );          
                        year1 = new JTextField( );
                        year1.setText( YearString );
                        year1.setEditable( true );
                        year1.setHorizontalAlignment( year1.CENTER );
                        fetch = new JButton( "Fetch Month" );
                        fetch.addActionListener( this );
                        top.setLayout( new GridLayout( 1, 3, 20, 0 ) );
                        top.add( months );
                        top.add( year1 );
                        top.add( fetch );
                   grid = new JPanel( );
                        grid.setLayout( new GridLayout( 7, 7, 0, 0 ) );
                        String [] week = { "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun" };
                        for ( int a = 0; a < 7; a ++ ) {
                                  JLabel lbl = new JLabel( week[a], JLabel.CENTER );
                                  grid.add( lbl );
                        for ( int i = 0; i < 42; i ++ ) {
                                  days[i] = new JButton( );
                                  grid.add( days[i] );
                                  days.addActionListener( this );
                        DrawCalendar( CurrentMonth, CurrentYear );
                        container.add( top, BorderLayout.NORTH );
                        container.add( grid, BorderLayout.CENTER );
              private void DrawCalendar( int SelectMonth, int SelectYear ) {
                        int DisplayMonthLength, Buttons;
                        String ButtonID = "";
                        int OffSet = MonthStart( SelectMonth, SelectYear );
                        DisplayMonthLength = MonthLength [SelectMonth - 1];
                        if ( SelectMonth == 2 )
                             DisplayMonthLength += LeapYear( SelectYear );
                        for ( Buttons = 1; Buttons < 43; Buttons ++ ) {
                             if ( ( Buttons <= OffSet ) || ( Buttons > ( DisplayMonthLength + OffSet ) ) ) {
                                  ButtonID = "";
                                  days[Buttons-1].setEnabled( false );
                             else {
                                  ButtonID = Integer.toString( Buttons - OffSet );
                                  days[Buttons-1].setEnabled( true );
                        days[Buttons-1].setLabel( ButtonID );
                        grid.add( days[Buttons-1] );
              private int LeapYear( int year ) {
                        int FourHundred, OneHundred, Fourth;
                        FourHundred = year % 400;
                        OneHundred = year % 100;
                        Fourth = year % 4;
                        if( ( ( FourHundred == 0 ) ) || ( ( OneHundred != 0 ) && ( Fourth == 0 ) ) )
                             return ( 1 );
                        else
                             return ( 0 );
              private int MonthStart( int Month, int Year ) {
                        int OffSet, LastMonths, BeforeOrAfter, Years;
                        int AllDays = 0;
                        int YearDays = 365;
                        int YearMonths = 12;
                        BeforeOrAfter = Year - 2006;
                        Years = abs( BeforeOrAfter );
                        if( BeforeOrAfter != 0 )
                             BeforeOrAfter = BeforeOrAfter / Years;
                        switch( BeforeOrAfter ) {
                             case 1:
                                  for( int a = 2006; a < Year; a ++ ) {
                                       AllDays += YearDays + LeapYear( a );
                                  AllDays += LastMonthsCalc( Month, Year );
                             break;
                             case -1:
                                  for( int a = 2005; a > Year; a -- ) {
                                       AllDays += YearDays + LeapYear( a );
                                  for( LastMonths = YearMonths; LastMonths >= Month; LastMonths -- ) {
                                       AllDays += MonthLength[LastMonths - 1];
                                       if( LastMonths == 2 )
                                            AllDays += LeapYear( Year );
                             break;
                             default:
                                  if( Month > 1 )
                                       AllDays += ( LastMonthsCalc( Month, Year ) );
                        OffSet = AllDays % 7;
                        if( BeforeOrAfter ==( -1 ) )
                             return( 6 - OffSet );
                        else if( OffSet > 0 )
                             return( OffSet - 1 );
                        else
                             return( 6 );
              private int LastMonthsCalc( int Month, int Year ) {
                        int Counter;
                        int days = 0;
                        for( Counter = 1; Counter < Month; Counter ++ ) {
                             days += MonthLength[Counter - 1];
                             if( Counter == 2 )
                                  days += LeapYear( Year );
                        return( days );
              public void CreateReminder( String buttonID, String yearID, String monthID ) {
                        reminderframe = new JFrame( );
                        reminderlbl = new JLabel( );
                        reminderframe.setLayout( new GridLayout( 2, 1, 0, 0 ) );
                        remindercenter = new JPanel( );
                             reminderlbl = new JLabel( "Please type in reminder to be saved for " + buttonID + " " + monthID + " " + yearID + ":", JLabel.CENTER );
                             reminderinput = new JTextField( 30 );
                             reminderinput.setHorizontalAlignment( reminderinput.CENTER );
                             reminderinput.setEditable( true );
                             remindercenter.setLayout( new GridLayout( 2, 1, 0, 0 ) );
                             remindercenter.add( reminderlbl );
                             remindercenter.add( reminderinput );
                        reminderbottom = new JPanel( );
                             save = new JButton( "Save" );
                             save.addActionListener( this );
                             cancel = new JButton( "Cancel" );
                             cancel.addActionListener( this );
                             dayno = new JTextField( buttonID );
                             dayno.setEditable( false );
                             dayno.setEnabled( false );
                             dayno.show( false );
                             reminderbottom.setLayout( new FlowLayout( ) );
                             reminderbottom.add( save );
                             reminderbottom.add( cancel );
                             reminderbottom.add( dayno );
                        reminderframe.setSize( 500, 75 );
                        reminderframe.add( remindercenter );
                        reminderframe.add( reminderbottom );
                        reminderframe.pack( );
                        reminderframe.show( );
              public void SaveReminder( String dayID, String yearID, String monthID ) throws Exception {
                        file = new File( "Diary.xml" );
                        doc = DocumentBuilderFactory.newInstance( ).newDocumentBuilder( ).parse( file.toURL( ).toString( ) );
                        String year = yearID;
                        String month = monthID;
                        String day = dayID;
                        //System.out.println( year );
                        //System.out.println( month );
                        //System.out.println( day );
                        CreateEntry( doc.getDocumentElement( ) );
                        writeXmlFile( );
              public boolean CreateEntry( Node node ) {
                        Node searchNode;
                        searchNode = getYear( node );
                        if( searchNode == null ) {
                             Element newNode = doc.createElement( "Year" );
                             searchNode = node.appendChild( newNode );
                             newNode.setAttribute( "Id", year );
                        node = searchNode;
                        searchNode = getMonth( node );
                        if( searchNode == null ) {
                             Element newNode = doc.createElement( "Month" );
                             searchNode = node.appendChild( newNode );
                             newNode.setAttribute( "Id", month );
                        node = searchNode;
                        searchNode = getDay( node );
                        if( searchNode == null ) {
                             Element newNode = doc.createElement( "Day" );
                             searchNode = node.appendChild( newNode );
                             newNode.setAttribute( "Id", day );
                        node = searchNode;
                        String entry = reminderinput.getText( );
                        Node textNode = doc.createTextNode( entry );
                        node.appendChild( textNode );
                        return true;
              private Node getYear( Node node ) {
                        node = node.getFirstChild( );
                        while( node != null ) {
                             if(node.getNodeName( ).equals( "Year" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == year )
                                  return node;
                                  node = node.getNextSibling( );                    
                        return null;
              private Node getMonth( Node node ) {
                        node = node.getFirstChild( );
                        while( node != null ) {
                             if( node.getNodeName( ).equals( "Month" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == month )
                                  return node;
                                  node = node.getNextSibling( );                    
                        return null;
              private Node getDay( Node node ) {
                        node = node.getFirstChild( );
                        while( node != null ) {
                             if( node.getNodeName( ).equals( "Day" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == day )
                                  return node;
                                  node = node.getNextSibling( );                    
                        return null;
              private void writeXmlFile( ) throws Exception {
                   Source source = new DOMSource( doc );
                        Result result = new StreamResult( file );
                   Transformer xformer = TransformerFactory.newInstance( ).newTransformer( );
                   xformer.setOutputProperty( OutputKeys.INDENT,"yes" );
                   xformer.setOutputProperty( OutputKeys.DOCTYPE_SYSTEM,"Diary.dtd" );
                   xformer.transform( source, result );
              public void actionPerformed( ActionEvent e ) {
                        String IDButton = e.getActionCommand( );
                        String IDYear = year1.getText( );
                        Object IDMonthObj = months.getSelectedItem( );
                        if( e.getSource( ) == fetch ) {
                             String YearText = year1.getText( );
                             int YearNumber = Integer.valueOf( YearText );
                             int MonthsIndex = months.getSelectedIndex( ) + 1;
                             DrawCalendar( MonthsIndex, YearNumber );
                        else if( e.getSource( ) == cancel ) {
                             reminderframe.hide( );
                        else if( e.getSource( ) == save ) {
                             String IDDay = dayno.getText( );
                             String IDMonth = String.valueOf( IDMonthObj );
                             SaveReminder( IDDay, IDYear, IDMonth );
                        else {
                             String IDMonth = String.valueOf( IDMonthObj );
                             Toolkit.getDefaultToolkit( ).beep( );
                             int n = JOptionPane.showConfirmDialog( null, "Set reminder on this date?", "Question", JOptionPane.YES_NO_OPTION );
                             if( n == JOptionPane.YES_OPTION ) {
                                  CreateReminder( IDButton, IDYear, IDMonth );
    If you compile it, you will realise that I get an error about exception handling. My lecturer gave me an example code of how to do the same thing without using a GUI:
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import java.io.*;
    import java.util.*;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    public class CallDOM
         Document doc;
         File file;
         Scanner input;
         int year, month, day;
         String currentYear, currentMonth;
         public static void main(String args[]) throws Exception
              CallDOM cd=new CallDOM();          
         CallDOM() throws Exception
              file=new File("Diary.xml");
              //create DOM from file
              doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file.toURL().toString());
              input=new Scanner(System.in);
              System.out.println("1) Create entry");
              System.out.println("2) Read entry");
              System.out.println("3) Show Diary");
              System.out.println("4) Quit");
              int choice=input.nextInt();
              while(choice!=4)
                   switch(choice)
                        case 1: GetDate();CreateEntry(doc.getDocumentElement());break;
                        case 2: GetDate();ReadEntry(doc.getDocumentElement());break;
                        case 3: ShowDiary(doc.getDocumentElement());
                   System.out.println("1) Create entry");
                   System.out.println("2) Read entry");
                   System.out.println("3) Show Diary");
                   System.out.println("4) Quit");
                   choice=input.nextInt();
              writeXmlFile();
         public void GetDate()
              System.out.println("Enter date (dd mm yyyy)");
              day=input.nextInt();
              month=input.nextInt();
              year=input.nextInt();
         public boolean ReadEntry(Node node)
              node = getYear(node);
              if(node==null) return false;
              node = getMonth(node);
              if(node==null) return false;
              node = getDay(node);
              if(node==null) return false;
              node = node.getFirstChild();
              while(node!=null)
                   System.out.println(node.getNodeValue().trim());     
                   node=node.getNextSibling();
              return true;               
         public boolean CreateEntry(Node node)
              Node searchNode;
              searchNode = getYear(node);
              if(searchNode==null)
                   Element newNode = doc.createElement("Year");
                   searchNode = node.appendChild(newNode);
                   newNode.setAttribute("Id",Integer.toString(year));
              node = searchNode;
              searchNode = getMonth(node);
              if(searchNode==null)
                   Element newNode = doc.createElement("Month");
                   searchNode = node.appendChild(newNode);
                   newNode.setAttribute("Id",Integer.toString(month));
              node = searchNode;
              searchNode = getDay(node);
              if(searchNode==null)
                   Element newNode = doc.createElement("Day");
                   searchNode = node.appendChild(newNode);
                   newNode.setAttribute("Id",Integer.toString(day));
              node = searchNode;
              System.out.println("Enter Text");
              String entry=input.next();
              entry+=input.nextLine();
              Node textNode = doc.createTextNode(entry);
              node.appendChild(textNode);
              return true;               
         public void ShowDiary(Node node)
              Stack<Node> stack=new Stack<Node>();
              Node child;
              stack.push(node);
              while(!stack.empty())
                   node = stack.pop();
                   if(ProcessNode(node))
                        child = node.getLastChild();
                        while(child!=null)
                             stack.push(child);
                             child = child.getPreviousSibling();
         private boolean ProcessNode(Node node)
              if(node.getNodeName().equals("Year"))
                   currentYear=node.getAttributes().item(0).getNodeValue();
              if(node.getNodeName().equals("Month"))
                   currentMonth=node.getAttributes().item(0).getNodeValue();
              if(node.getNodeName().equals("Day"))
                   System.out.print(node.getAttributes().item(0).getNodeValue()+"/"+
                                            currentMonth+"/"+currentYear+": ");
                   node=node.getFirstChild();
                   while(node!=null)
                        System.out.println(node.getNodeValue().trim());
                        node=node.getNextSibling();
                   return false;
              return true;               
         private Node getYear(Node node)
              node=node.getFirstChild();
              while(node!=null)
                   if(node.getNodeName().equals("Year")
                        && Integer.valueOf(node.getAttributes().item(0).getNodeValue())==year)
                             return node;
                   node = node.getNextSibling();                    
              return null;
         private Node getMonth(Node node)
              node=node.getFirstChild();
              while(node!=null)
                   if(node.getNodeName().equals("Month")
                        && Integer.valueOf(node.getAttributes().item(0).getNodeValue())==month)
                        return node;
                   node = node.getNextSibling();                    
              return null;
         private Node getDay(Node node)
              node=node.getFirstChild();
              while(node!=null)
                   if(node.getNodeName().equals("Day")
                        && Integer.valueOf(node.getAttributes().item(0).getNodeValue())==day)
                        return node;
                   node = node.getNextSibling();                    
              return null;
         private void writeXmlFile() throws Exception
            Source source = new DOMSource(doc);
            Result result = new StreamResult(file);
            Transformer xformer = TransformerFactory.newInstance().newTransformer();
            xformer.setOutputProperty(OutputKeys.INDENT,"yes");
            xformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"Diary.dtd");
            xformer.transform(source, result);
    }My question is, why does the exceptions in the example code not need to be caught? And why do I have to catch the exceptions in my code? Several exceptions are thrown in the example code, but there is no catch statement.
    Thanks for any advice!!

    Since your question didn't come with any relevant details, and since you have huge steaming piles of irrelevant code, all I can give is a general answer to "Why do I need to catch this exception?"
    [url http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html]Exception tutorial at http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
    Here's a quick overview of exceptions:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • I am working on a MacBook Pro (13-inch, Mid 2009) with boot camp running Windows 7 pro 64-bit.  Windows crashes quite often now-a-days and I need to get this fixed. I heard that updating boot camp can help.  Currently I am running Version 3.0.4 (322).

    I need to know which update(s) I can apply to help stabalize the system.

    Typing the body of the thread message in the title, huh? -)
    I am working on a MacBook Pro (13-inch, Mid 2009) with boot camp running Windows 7 pro 64-bit.  Windows crashes quite often now-a-days and I need to get this fixed. I heard that updating boot camp can help.  Currently I am running Version 3.0.4 (322).
    Only Apple could hamstring and tie Mac OS to Windows. There isn't any other than whether you can download the drivers into Windows (you can) but Apple puts a block on the installer setup even if your mac does not support it.
    Windows 7 needs at least Boot Camp 3.1 and 3.3 is what you should already have. And you are not getting security updates if you don't have at least 10.6.8 as was pointed out.  --- you arent using Software Update as you should. And you should backup and clone Mac (and Windows) as well.
    You need Mountain Lion to use Boot Camp 5.x which supports Windows 7 & 8 and 64-bit.
    I would upgrade to Lion if you can realizing that Rosetta and PowerPC are no longer supported though.
    Mac 101: Using Windows on your Mac via Boot Camp
    https://support.apple.com/kb/HT1461
    http://www.apple.com/support/bootcamp/
    Helpful Apple Support Resources (Forum Overview)
    Boot Camp Support 
    Boot Camp Manuals
    Boot Camp 5.0 Drivers
    http://support.apple.com/kb/DL1638
    Frequently asked question
    http://support.apple.com/kb/HT4818
    http://manuals.info.apple.com/en_US/boot_camp_install-setup_10.7.pdf
    http://manuals.info.apple.com/en/Boot_Camp_Install-Setup_10.6.pdf
    http://manuals.info.apple.com/en/Boot_Camp_Install-Setup_10.6.pdfcreate a Windows support software (drivers) CD or USB storage media
    http://support.apple.com/kb/HT4407
    The Boot Camp Assistant can burn Boot Camp software (drivers) to a DVD or copy it to a USB storage device, such as a flash drive or hard drive. These are the only media you can use to install Boot Camp software.
    https://support.apple.com/kb/HT4569
    http://manuals.info.apple.com/en_US/boot_camp_install-setup_10.8.pdf
    Instructions for all features and settings.
    Boot Camp 4.0 FAQ Get answers to commonly asked Boot Camp questions.
    Windows 7 FAQ Answers to commonly asked Windows 7 questions.
    http://www.apple.com/support/bootcamp/
    Is there a download of the Boot Camp 5 Support Software if I'm not using OS X Mountain Lion v10.8.3?
    Yes, you can download the Boot Camp 5 Support Software here.
    http://support.apple.com/kb/DL1638
    How do I use the Boot Camp 5 Support Software I downloaded from the web page?
    The download file is a .zip file. Double click it to uncompress it.
    Double-click the Boot Camp disk image.
    Copy the Boot Camp and "$WinPEDriver$" folders to the root level of a USB flash drive or hard drive that is formatted with the FAT file system (see question below for steps on how to format).
    Install Windows, leaving the flash or hard drive attached to the USB port of your Mac.
    Installation of the drivers can take a few minutes. Don't interrupt the installation process. A completion dialog box will appear when everything is installed. Click Finish when the dialog appears.
    When your system restarts your Windows 8 installation is done.
    Note: If the flash drive or hard drive was not attached when you installed Windows and was inserted after restarting into Windows 8, double-click the Boot Camp folder, then locate and double click the "setup.exe" file to start the installation of the Boot Camp 5 Support Software.
    How do I format USB media to the FAT file system?
    Use Disk Utility to format a disk to use with a Windows computer. Here's how:
    Important: Formatting a disk erases all the files on it. Copy any files you want to save to another disk before formatting the disk.
    Open Disk Utility.
    Select the disk you want to format for use with Windows computers.
    Click Erase, and choose one of the following from the Format pop-up menu:
    If the size of the disk is 32 GB or less, choose MS-DOS (FAT).
    If the size of the disk is over 32 GB, choose ExFAT.
    Type a name for the disk. The maximum length is 11 characters.
    Click the Erase button and then click Erase again.
    Which versions of Windows are supported with Boot Camp 5?
    64-bit versions of Windows 8 and Windows 7 are supported using the Boot Camp 5 Support Software. If you need to use a 32-bit version, you need to use Boot Camp 4 Support Software, and you must use Windows 7. 32-bit versions of Windows 8 are not supported via Boot Camp. For a complete list of Windows OS support, click here.

  • Need to resolve date format problem in form

    Hi,
    i have a column in database needed_date its format is --------> mm/dd/rr
    i need in my form a lov that uses the "needed_date" but displayed this date in oracle format which is ------> DD-MON-RR
    , then I assigned this lov to :p_needed_date paramter which i have to put it in :global to be able to compare it later in my master block which is based on from clause query in this format i converted it through the following code ------->SelecT (to_char(to_date(:PARMS.P_needed_date,'DD-MON-RR'),'mm/dd/rr')) into :GLOBAL.fro_date from dual ;
    as i canot in the where clause the following ---->(to_char(to_date(needed_date,'DD-MON-RR'),'mm/dd/rr')) between :global.from_date and :global.to_date
    i get invalid month as i'm sure that the item is date type
    so wht can i do ???

    Hello,
    Put the following in a PRE-FORM trigger, so that you would have no need to do any conversion nowhere.
    Forms_Ddl('ALTER SESSION SET NLS_DATE_FORMAT = ''DD-MON-RR'');
    Set_Application_Property(PLSQL_DATE_FORMAT, 'DD-MON-RR') ;
    Set_Application_Property(BUILTIN_DATE_FORMAT, 'DD-MON-RR') ;Francois

  • ICloud password works on everything but erasing all data. I got a new iPhone and need to wipe this one but am not sure how else to do this since the password is not working. Any suggestions?

    iCloud password works on everything but erasing all data. I got a new iPhone and need to wipe this one but am not sure how else to do this since the password is not working. Any suggestions?

    Firefox also makes regular backups of your bookmarks in a folder named bookmarkbackups in your personal settings folder. You can restore the backup to your new Firefox, but unlike importing the HTML-format file, it is a complete drop-in replacement, so if you have saved new bookmarks you do not want to lose, the export/import method may work better for you.
    By default, Windows hides your personal settings folder so the easiest way to access it is from inside Firefox. You can use either:
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This will launch a window showing your Firefox settings files.
    You might want to back up this whole folder if you have other data you want to preserve from your XP computer.
    Either way, you should find the bookmarkbackups folder here and when you click into it, find maybe 10 files with dates in their names.
    The procedure to restore the file once you have it on removable media or some other convenient place is described in this article: [[Restore bookmarks from backup or move them to another computer]].
    Regarding the other files and what you might find of use: [[Recovering important data from an old profile]].

  • I have a western digital external hard drive that needs to be re formatted for use on my but iMac but I do not want to lose existing data

    I have a Western Digital external hard drive that needs to be re formatted for use on my iMac, but I do not want to lose existing data, is this possible ?

    Formatting a disk always erases all the data on it. Your only option is to back it up elsewhere and restore it once formatted.

  • Date Format (Need result in date format)

    Dear ,
    i have worked on this query which produce result in error, infact i need result in date format and this format 'MON-YY'. :
    select to_date( EFFECTIVE_DATE,'MON-YY' ) as MON_YY FROM GL_JE_LINES
    but now EFFECTIVE_DATE is like this format '12/31/2008'

    I tell again: a date has no internal format.
    There is only a default output-format for date-objects wich is used as default output format and for implicit date conversions.
    If you want to know the actual nls_date_format for your session you can use:
    select * from nls_session_parameters where parameter='NLS_DATE_FORMAT';You can change it for your session with:
    alter session set nls_date_format='<your_new_date_format>';Please take a look at:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams122.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#sthref405
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements003.htm#BABGIGCJ
    The internal storage of a date-object does not depend on the actual value of NLS_DATE_FORMAT.
    This will only used for output and for implicit conversions e.g. with to_date or to_char without explicit format.
    To select a date from a table is also an implicit conversion to character, because you want to see characters on your screen.
    Edited by: hm on 29.12.2010 04:20

  • Date should be in this format DD-MON-YYYY  HH:MI:SS

    Hi All,
    I am having a column date data type ,in that i am using SYSDATE and formating as DD-MON-YYYY HH:MI:SS but result iam not getting in this format,any one please help me regarding this..
    Thanks in Advance..
    Edited by: 30021986 on Oct 14, 2012 1:38 PM
    Edited by: 30021986 on Oct 14, 2012 3:38 PM

    there is a misunderstanding.
    Your database column is in a DATE type. This is a type, and thanks to this type, you can DISPLAY the date in various ways in a query editor (toad, sql developer...).
    I mean, there is no various physical Date type columns, but only one called "date".
    If you want to display this date in the way "DD-MON-YYYY HH:MI:SS", then convert it into "CHAR" (or VARCHAR) type with the function TO_CHAR (in oracle).
    Example : to_char(sysdate, 'DD-MMMM-YYYY HH24:MI:SS").
    But the result will be an alphanumeric type. You won't be able to do further operation on date, like adding a day for instance.
    That's why you should keep the date format in the column of your database table, but convert it in your queries.
    If you really need to have this specified format, then use the char or varchar type in your database table.

Maybe you are looking for

  • Qosmio F30-117: How long does the repair take?

    can any body tell me how long does it take for toshiba repair center to repair the laptop and send it back. I bought this new laptop but there was harddisk fault, then i sent it for repair but not yet received. Its two weeks now.

  • Unable to connect crystal reports to Pervasive SQL V9

    We have crystal XI on seperate machine than Pervasive SQL. The Crystal designer is accessed via Citrix servers. Please help with configuration. 1. How do I get ODBC on crystal server? 2. Do I need ODBC on citrix machine as well since the developer wi

  • Applet Alert messagae

    I am having trouble migrating an Access 2000 db to Oracle. I generated the XML file using omwb2000.mde but when I try to add the XML in the OMWB Capture Wizard I get an 'Applet Alert'. This says: The applet thread is trying to perform java/io/File.ge

  • IPad not posting to shared album

    I've been sharing photos on various albums for nearly a year with no problems. Suddenly it has stopped working properly. When I share a photo from my iPad, I cannot see it on my iPhone shared album and no one else can see it either on that album. If

  • Illustrator won't download - Opens up Photoshop

    I have the Creative Cloud and downloaded InDesign and Photoshop a few weeks ago. Am trying to download Illustrator but everytime I click the download link it automatically opens up my Photoshop. This is the page I'm trying to download from: https://c