How to convert parameter in to proper date format in unix.

My requirement is to convert parameter string (012011) as a date in unix without support from other like sql. then once it is converted into date format how to increment it by one day. Here i want to use my own date rather than system timestamp of unix system. Please help.
I am unix HP unix 11.

Moderator Action:
Your question is outside the scope of this Linux forum space, and is locked.
You seem to hope for assistance with a specific Unix that is a product from a specific company.
I suggest you go to that company's forum community and ask there.  You will undoubtedly find many people there that are familiar with the nuances if that OS.

Similar Messages

  • How to convert a string into orcle date format

    i need some information about converting string into date format.i have string like '20-SEP-05' .so we have to convert into date formate like yy-mm-dd' (2005-09-20).how can we do it.

    Here's some code to help. I can't remember what method uses what format though
      public static java.sql.Date sqlDateValueOf( String dateString ) {
        String stringDate = null;
        if ( dateString == null || dateString.length() < 10 ) return null;
        String strDay = "";
        String strMonth = "";
        String strYear = "";
        if ( dateString.substring(4,5).equals( "-" ) ) {
          strDay = dateString.substring(8, 10);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(5, 7);
          strMonth = dateString.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(0, 4);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        else if ( dateString.substring(2,3).equals( "-" ) ) {
          strDay = dateString.substring(0, 2);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(3, 5);
          strMonth = String.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(6, 10);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        Calendar cal = Calendar.getInstance();
        cal.set( Calendar.YEAR, Integer.parseInt( strYear ) );
        cal.set( Calendar.MONTH, Integer.parseInt( strMonth ) );
        cal.set( Calendar.DAY_OF_MONTH, Integer.parseInt( strDay ) );
        java.sql.Date outDate = new java.sql.Date( cal.getTimeInMillis() );
        return outDate;
      public static String toDateString( java.util.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date, String format) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat( format );
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Timestamp date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      }

  • I have a MacBook Pro, I want to copy Itunes files to an SD card to play in my car, the SD Card doesn't appear in Itunes when I insert it, and I don't know how to convert the files to the correct format, can anyone help?

    I have a MacBook Pro, I want to copy Itunes files to an SD card to play in my car, the SD Card doesn't appear in Itunes when I insert it, and I don't know how to convert the files to the correct format, can anyone help?
    Thank you

    So it seems from reading the COMMAND manual that my first issue is that I used a 16GB SD card, and the manual says it will only recogize up to a 2GB SD card. I did use my MB Air's SD card slot and crated a folder and dragged the music files to it, then to the card. So I am going to get a 2GB card and try that next. Otherwise just stick with the iPOD connected. At least that is 8GB

  • How do I set a custom time & date format in the top bar?

    Hello guys,
    Very embarassing question, because I've had Apple's for all of my life (starting with the original Apple Macintosh) but I still haven't figured out one thing
    How do I set a custom time & date format in the top bar?
    When I go to System Preferences > Language & Text > Formats I can set different formats. I have no idea where you will see these, but I know that it's not the top bar where the time and date is being displayed. Because no matter what I enter, the format in the top bar will stay the same. I can only choose things like 24-Hour clock or not, blinking dots and so on in the Time & Date settings from the System Preferences.
    Can anyone here point me in the right direction? I see you can even choose to display the week of the year - I'd love to do that!
    All help appreciated!
    Greetings

    Language & Text system preferences, Formats tab, customize dates.
    There are also many third party menu item utilities that can.  Search Macupdate.com for some.
    One search yielded iClock Pro.  Although I never used it I would think it allows customization.  The link I gave you is to the Macupdate download page for that app.  On that same page is a Similar Software section which has other apps that can do the same thing. 
    One listed is iStat Menus.  The primary use for iStat Menus is not for displaying date/time but it does do that.  And I know it can do what you want because I use iStat Menus to track temperature sensors n my machine and, like you, I want to customize the menu time/date.  So I use it instead of the apple clock.  It does have the customization features I think you are looking for.

  • How can I take minutes from mysql date format

    how can I take minutes from mysql date format??
    example 10:30:00 is stored in my sql and I want to create 3 variables which will store hours, minutes and seconds..
    Cheers..

    "use application date format" is the choice you want.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to convert a string value to date

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    In your post you ask how to convert a string value to a date.  The value returned from the Get-AdUser is already a date.  It does not need to be converted.
    Bill has sshown one way to convert a date to a string and there are other methods.  You need to clarify your question.
    If you are really trying ot convert strings to dates then you can start with this:
    [datetime]'01/21/1965 13:33:23'
    Most date strings aer autodetected by the class.
    ¯\_(ツ)_/¯

  • How to convert flat file type from DAT to ASC

    hello all
    i am trying to download a flat file and trying  to upload it in another program.
    for this i am using gui_upload and gui_download function modules.
    if i download the file as ASC and upload with ASC there is no problem.
    if i download the file as DAT and upload with DAT its giving an exception invalid file type
    if i download the file as DAT and upload with  ASC  its giving an exception bad data format.
    but in real senario my customer is sending a flat file with DAT type and i am unable to upload it.
    how to solve this problem?

    Hi,
    when uploading DAT pass file type as 'ASC' and give HAS_FIELD_SEPARATOR  = 'X'.
    For other types see the code below.
    CASE P_RECTYP.
       WHEN 'DAT'.
         MOVE 'X' TO L_FLDSEP.
         MOVE 'ASC' TO L_TYPE.
       WHEN 'ASC'.
          MOVE ' ' TO L_FLDSEP.
          MOVE P_RECTYP TO L_TYPE.
       WHEN 'BIN'.
           CLEAR L_TYPE.
         MOVE P_RECTYP TO L_TYPE.
         MOVE ' ' TO L_FLDSEP.
       WHEN OTHERS.
        MOVE 'X'  TO L_FLDSEP.
        MOVE 'ASC' TO L_TYPE.
    ENDCASE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = LV_FILENAME
       FILETYPE                      = l_type
       HAS_FIELD_SEPARATOR           = l_fldsep
    Regards,
    Vasanth

  • Converting a string into mySQL date format

    I have a bit of code that collects data values from a bean and I want it to then insert this into a mySQL database. My string is in the format "23/12/1983", how can i put this into a date field in my database? The bit of code I have got so far looks like this...
    String month = formHandler.month + "/";
    String day = formHandler.day + "/";
    String year = formHandler.year ;
    StringBuffer sb = new StringBuffer();
    sb.append(day);
    sb.append(month);
    sb.append(year);
    String myDate = sb.toString();myDate is the value that I want to go into the database

    Limo2kz,
    The key to inserting a date into a database is to convert the date string into an SQL friendly format. i.e. yyyy-MM-dd.
    One way of doing this is as follows:
    SimpleDateFormat NICE_DATE_FORMAT =
    new SimpleDateFormat("dd/MM/yyyy");
    SimpleDateFormat SQL_DATE_FORMAT =
    new SimpleDateFormat("yyyy-MM-dd");
    Date date = new Date();
    try {
    date = NICE_DATE_FORMAT.parse(dateString);
    } catch (ParseException pe) {
    pe.printStackTrace();
    String sqlDate = SQL_DATE_FORMAT.format(date);
    Now it is just a matter of creating the insert statement like normal, and making sure that the date string is in quotes.
    I hope that helps.
    Damian Sutton

  • How to convert binary file to a particular format?

    Hi,
    I am having a requirement. I have in database various kinds of files stored as binary format. Its a sybase database. Now the files can be .pdf, or .doc also. But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column value which contains the file in binary format.
    But tricky part is how to convert the binary file entry in a proper respective file format? So I have another column which basically has the value to tell the type of file. So I have ".doc" or ".pdf" as each entry of file...
    So please help me how can we do this using Java?
    THanks

    Hi,
    I am having a requirement. I have in database various
    kinds of files stored as binary format. Its a sybase
    database. Now the files can be .pdf, or .doc also.
    But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column
    value which contains the file in binary format.
    But tricky part is how to convert the binary file
    entry in a proper respective file format? So I have
    another column which basically has the value to tell
    the type of file. So I have ".doc" or ".pdf" as each
    entry of file...
    So please help me how can we do this using Java?
    THanks

  • How to convert message in XI into PDF format

    Hi,
    I am trying out a scenario where i am getting an idoc from SAP into XI and now in XI i need to convert the data into pdf format and send that pdf in a mail using mail adapter.
    Can any body help me out how to convert a message in XI to pdf format.
    Thanks in Advance!!
    Regards,
    Sudheer

    Hi Sudheer
    follow these links
    http://www.erpgenie.com/sap/sapedi/Conversion%20of%20IDOCs%20to%20XML%20format.pdf
    Here is the complete code for you;
    It Converts spool request into PDF document and emails it.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Smartform as attachment in mail. - 46k
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/convert-smartforms-form-in-pdf-998715 - 87k
    SMART form to PDF
    https://wiki.sdn.sap.com/wiki/display/Snippets/ConvertSmartformtoPDFformat
    smartform to MAIL
    https://wiki.sdn.sap.com/wiki/display/Snippets/SmartformtoMailasPDF+attachment
    Regards
    Sandeep Sharma
    PS: if helpful kindly reward points

  • Needed help regarding converting  string to java.sql.Date format

    I have a a function which returns a calendar object. The date must be inserted to Oracle DB using java.sql.Date format.
    So i have converted the Calendar object to java.sql.Date format using the following code
    java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());But while getting inserted into the DB it was in mm/dd/yyyy format whereas i wanted dd/mm/yyyy format
    Can any body please help out how to store the date in dd/mm/yyyy format ?

    Can u please explain this a bit
    This is my code
    public int addBook(List<Book> BookList) throws SQLException, ParseException{
              System.out.println("Hi there");
              Book book = new Book();
              BookDB bookDb = new BookDB();
              //listLength =      BookList.length;
              String bookId = null;
                   try{
                        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                        con  = DriverManager.getConnection("jdbc:oracle:thin:@10.123.79.195:1521:findb01","e115314", "e115314");
                        addBook = con.prepareStatement("insert into ABC_Book values(?,?,?,?,?,?,?)");
                        Iterator<Book> iterator = BookList.iterator();
                        while(iterator.hasNext()){
                             book = (Book)iterator.next();
                             System.out.println(book.getBookId());
                             addBook.setString(1,book.getBookId());
                             addBook.setString(2,book.getTitle());
                             addBook.setString(3,book.getAuthor());
                             addBook.setString(4,book.getPublisher());
                             System.out.println(book.getPublicationDate());
                             System.out.println("Before Date");
                             System.out.println("book.getPublicationDate().getTime()"+book.getPublicationDate().getTime());
                             java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());
                             SimpleDateFormat formatter = new SimpleDateFormat("dd/mm/yyyy");
                             dateString = formatter.format(publicationDate);
                             System.out.println("Today is"+dateString);
                             java.sql.Date date = (java.sql.Date)formatter.parse(dateString);
                             System.out.println("date"+date);
                             //java.sql.Date publicationDate = (Date)book.getPublicationDate().getTime();
                             //System.out.println("Value of date is"+publicationDate);
                             System.out.println("After Date");
                             addBook.setDate(5,publicationDate);
                             addBook.setString(6,book.getCountry());
                             addBook.setString(7,book.getLanguage());
                             rs = addBook.executeQuery();
                             //con.commit();
                             rowCount = rowCount + rs.getRow();
                        return rowCount;
                   catch(SQLException se){
                        se.printStackTrace();
                   finally{
                        con.close();
                        System.out.println("After adding ");
              return 0;
         }

  • How to change open file dialogue box date format

    Hi - I can't find how to change the date format whenever I open any creative suite document - my system preferences are set to dd/mm/yy and every other application shows this date except for CS4 it shows mm/dd/yy. Can anyone help please. Much appreciated.

    Hi, I'm having the same problem with the date format - all Creative Suite 'open' menu items are showing US format mm/dd/yyyy rather than UK format dd/mm/yyyy... although everything else on my system is set for UK format and all other programs open properly. The strange thing is: I'm sure this has only just happened after years of using Creative Suite... I'm sure I would have noticed it before. I'm on CS3 so haven't had any recent updates that might have affected it.

  • How to convert cXML dtd files into xsd format and use them into BPEL application

    Hi,
    In my BPEL application I have to use cXML dtd files by converting them into xsd format.
    I have used 'Microsoft Visual Studio' for converting cXML.dtd file into xsd format, for this 1 dtd file I am getting three xsd files (cXML.xsd, cXML1.xsd and cXML2.xsd).
    Please check this once and let me know
    1. why I am getting three xsd files for one dtd file,
    2. how can I use cXML.xsd file in my application, do I ll have to use all the three files in my BPEL app and
    3. what should I include in main xsd file (cXML.xsd) to import other two xsd files.
    kindly check this once and let me know your suggestions .
    Thanks

    Hi,
    While downloading the cXML dtd there will be example xml files. Using this xml's we can generate xsd.
    Regards,
    KANN.

  • Converting the string value to data format

    Hello Everyone,
                                  Please guide me in converting the value to date format.
    from source i'm getting the value (which is acchally a data value) '20070730'.
    I need this value to be in date format '2007/07/30'
    Please help me in getting it done.
    thank you

    Hi
    Code Snippetselect cast('20070730' as datetime)
    Note : beware of collation used in your SQL instance or your database.
    Jean-Pierre

  • Converting httpSession creation time to Date format

    I have the need to convert the value returned from httpSession.getCreationTime() to a Date format. The value returned from getCreationTime is long. I need to parse this value into 2 other fields. The first needs to be in year, month, day format. The second must give me the time in hours, minutes, seconds and milliseconds. Thanks in advance for any help you can give me.

    Simple:Date date = new Date(httpSession.getCreationTime())

Maybe you are looking for

  • [SOLVED] pacman: grep database for specific packages?

    $ pacman -Ss zsh extra/grml-zsh-config 0.9.1-1 grml's zsh setup extra/zsh 5.0.2-4 [installed] A very advanced and programmable command interpreter (shell) for UNIX community/zsh-lovers 0.8.3-2 A collection of tips, tricks and examples for the Z shell

  • Java calendar works in IE but not in Firefox

    This Java code works in IE but not in Firefox - any ideas - tks <pre><nowiki><TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4; left: 28px; top: 365px"> <TBODY> <TR> <TD colSp

  • Message loss during network connection reset

    We are planning on using Oracle streams for async notifications between the database and our Java application. While testing for some edge cases we are running into the following issue. 1) Start Java code(Waiting to dequeue message) -> disconnect net

  • 2nd Loch Ness?- Ominous SEND button during call

    Does anyone of you guys know what it is and what it does? HOW DID IT APPEAR? During a call today (I was getting called) I put the phone on the desk, making the display turn on again. In the top part of the screen, where you can find the caller ID and

  • Movieclip in flex

    I have created a rotating wheel and need to instantiate it in flex...i would prefer doing it in the mxml section as sizing/ positioning are handled automatically (tried doing in the ActionScript section- am not able to control the size/ position on s