Xsd datetime format

Hi, I'm using a javascript popup calendar on a web page which can return a timestamp in either of 3 formats (i can choose whichever):
dd-mm-yyyy hh:mm:ss
mm/dd/yyyy hh:mm:ss
yyyy-mm-dd hh:mm:ss
I want to convert this form value into the xsd datetime format yyyy-MM-ddThh:mm:ss.
How can I do this?
I have been using the following code, but this just deals with today's date. I need to alter it so that it can deal with the value from the popup calendar:
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
StringBuffer sb = new StringBuffer( sdf.format(calendar.getTime()) );

There is no piece ion your code which would set any value.
Check the API for Calendar, it has many useful methods.

Similar Messages

  • Xsd:dateTime formatting problems

    This is driving me nuts. I've been playing around with JAXB and it has worked great so far. Until now.
    I have an xml file with this little block
       <timestamps>
          <created>2000-03-04T20:00:00Z</created>
          <last_modified>2003-03-14T02:20:02-05:00</last_modified>
       </timestamps>and in my xsd file I have
        <xsd:element name="timestamps" type="timestampsType" />
      <xsd:complexType name="timestampsType">
        <xsd:sequence>
          <xsd:element name="created" type="xsd:dateTime" />
          <xsd:element name="last_modified" type="xsd:dateTime" />
        </xsd:sequence>
      </xsd:complexType>Previously I had used just xsd:date instead of xsd:dateTime, and that worked fine, but then I realized that I needed more timing precision so I made the change. I can generate my java files with xjc without any problems. But when I go to unmarshall the xml file with validation on, I always get a complaint about the formatting of my date time values. More specificaly I see:
    "com.sun.msv.verifier.ValidityViolation: "2000-03-04T20:00:00Z" does not satisfy the "date" type"
    despite the fact that I copied this date directly from the XSD specification page at http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
    And believe me, I've tried about a dozen other variations.... Different dates, with extra milliseconds, with and without the timezone part at the end. I get the same error every time. So what am I doing wrong?

    Thanks, but unfortunately that did not do the trick. Interestingly enough everything works perfectly, all other things the same, when I let Validation be set to false.

  • Tip : datetime formats in XSD

    Hi,
    When reading a file, we wanted to specify the datetime format as something like : 02-JAN-2006 (with the name of the month).
    The datetime patterns can be directly set in the XSD of the file adapter because BPEL uses JAVA patterns. See doc : http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    As a consequence, a date field in the XSD will look like this :
    <element name="PurchaseDate" type="dateTime"
    nxsd:dateFormat="dd-MMM-yyyy"
    nxsd:style="terminated" nxsd:terminatedBy="${eol}" /> ]]
    I hope you will find this tip useful !
    Alexandre

    You can set different allowed input date-formats Re: format date
    Check if that setting exists in your forms60-environment and add it to your 10g-env-file (use FORMS_ instead of FORMS60_)

  • How to deal with xsd:dateTime from webservice in ADF? (Frank can you help?)

    I have a webservice that returns a date in the yyyy-MM-dd'T'HH:mm:ss.SSSZ format (as far as i know the default Calendar type format) specified by an xsd:dateTime. When i generate a webservice datacontrol on the service i get an entry like <Attribute Name="testDate" IsUpdateable="0" Type="java.util.Date" /> in the datacontrol xml file generated for the service (should that not be a java.util.Calendar type?). When i try to output the value on a jsf page it results in the following error:
    oracle.jbo.domain.DataCreationException: JBO-25009: Can not create object of type java.util.Date with value 1994-02-01T00:00:00.000+01:00
    As far as i understand adf tries to create a java.util.Date object from the webservice output 'string' which fails. The webservice is a plsql webservice generated with jdeveloper. If i change the type in the datacontrol xml file from java.util.Date to java.lang.String it prints out the entire date string but i would like to keep it a date type to be able to format the output to the dd-MM-yyyy pattern.
    Any help or suggestions.....?
    Kind Regards,
    Andre Jochems
    Repost
    Repost

    Andre,
    sorry, for not replying earlier - missed this post obviously. I don't know whether or not the behavior you see is correct or a bug - need to investigate this first (or find somebody to invest).
    However, as a work around for now you can:
    Option 1: bind the UI component to a managed bean that then accesses the binding layer to access the Web Service Data Control. This way you can work with Strings and just create a java.util.Date object for the component using the SimpleDate formatter
    Option 2: Use a Web Service proxy and a JavaBean DataControl to access the proxy. This allows pre-processing of the Web Service response, e.g. handling the Date
    Note that this is just for possible work around until I find the time to look at this. However, if this is a blocking issue for a production application then I suggest to contact customer support for immediate help
    Frank

  • Save xsd:dateTime in java.util.Date

    Hi,
    can anybody give me a code snippet to save a String representing an xsd:dateTime (probably containing timezone information) to java.util.Date?
    I really don't know how to do it.
    Thanks,
    Sven

    In general if you have a String that contains a formatted date, and you want to make a Date object out of that, then you use a java.text.SimpleDateFormat object and its parse() method.

  • How To Get Only Month or Only Year from datetime format of yyyy-mm-dd

    Hi SQL gurus,
    I have field has datetime format of yyyy-mm-dd (ie. 2014-11-28).  Could anyone please educate me on how to extract only month (ie. November but not 11) and only year (ie, 2014) from 2014-11-28.  I writing two report have title of Number of
    sick leaves on November  and Number of sick leaves in 2014.  I am planning to extact 11 from 2014-11-28 and display as November on report title and the same goes for 2014.  Unless you have better non complicated way.   Thank you
    very much in advance.  DingDong!!

    There are multiple ways
    Month name
    SELECT DATENAME(mm,@DateParam)
    SELECT FORMAT(@DateParam,'MMMM')
    Year
    SELECT FORMAT(@DateParam,'yyyy')
    SELECT DATEPART(yy,@DateParam)
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Mediator - convert XSD datetime to SQL date value

    Fusion 11g, JDev 11.1.1, W server 2008
    Hi there,
    using JDev we've defined a DB adapter (towards an ORACLE schema), which basically serves two operations: INSERT and SELECT. On the DB table we've got a DATE_TIME while on on the other side we've defined a wsdl where the INPUT operation takes as parameter an XSD DATETIME value.
    The values have different structures and so we've started to play with the "Assign Values" function on the Mediator component, unfortunately without any success.
    Right now our expression is the following
    from
    ora:formatDate($in.newEventParam/newEventParam/ns:executionTime,"dd-MMM-yy")
    to
    $out.LogCollection/top:LogCollection/top:Log/top:when
    As first question I would like to ask you if our approach is correct and in that case what's wrong with our expression as we tried to use the same pattern as we use in SQL.
    Second, we performed some tests using the EM console. On test failure it shown a stack trace saying only that there was a problem performing a transformation. That's a bit too less, especially when transformation is done on large amount of values. Is there any way to increase trace level and get further details on which transformation didn't work out?
    Thanks in advance
    Alessandro Ilardo

    Thanks Eric for the link. That helped me to get further details about the issue but unfortunately not enough to locate the cause.
    So here I definitely have an issue with the composite application and perhaps another one on getting a SOAP trace from the Mediator log. Even with the finest log level enabled I couldn't see what the Mediator receives from outside.
    The first problem instead, seams to be a missing SOAP parameter, I assume that's why on the log I see this
    [WEBSERVICE.name: AuditService] [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Transformation failed[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01203:[No Part]No part exist with name "newEventParam" in source message.Possible Fix:Review the transformation definition in mplan.Contact Oracle Support if the error cannot be fixed.
         at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:221)
    [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Got an exception: java.lang.NullPointerException[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01201:[Error in transform operation]Error occurred while transforming payload.Possible Fix:Review the XSL or source payload. Either the XSL defined does not match with the payload or payload is invalid.
    In this routing there are basically 2 things that take place, an XSL mapping and an Assign value expression.
    Everything is goes fine until we perform a test from the EM, there we get the error.
    Unless someone has further tips on this issue I am considering to make a call from SOAPUI and place WS Monitor in the middle to make sure if the mistake is in the application or platform.
    External WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl" xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" targetNamespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl">
         <wsdl:types>
              <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" schemaLocation="xsd/AuditParamsDef.xsd"/>
              </schema>
         </wsdl:types>
         <wsdl:message name="addNewRequestMessage">
              <wsdl:part name="newEventParam" type="ns:add"/>
         </wsdl:message>
         <wsdl:message name="searchRequestMessage">
              <wsdl:part name="searchParams" type="ns:search"/>
         </wsdl:message>
         <wsdl:message name="searchResponseMessage">
              <wsdl:part name="returnParam" type="ns:eventObj"/>
         </wsdl:message>
         <wsdl:portType name="AuditPortType">
              <wsdl:operation name="addNewEvent">
                   <wsdl:input message="tns:addNewRequestMessage"/>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <wsdl:input message="tns:searchRequestMessage"/>
                   <wsdl:output message="tns:searchResponseMessage"/>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="AuditBinding" type="tns:AuditPortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="addNewEvent">
                   <soap:operation soapAction="urn:#addNewEvent"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <soap:operation soapAction="urn:#searchForEvents"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <!--
         <wsdl:service name="AuditService">
              <wsdl:port name="AuditPort" binding="tns:AuditBinding" />
         </wsdl:service>
    -->
    </wsdl:definitions>
    XSL
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="../AuditService.wsdl"/>
    <rootElement name="newEventParam" namespace=""/>
    <rootElementDatatype name="add" namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="WSDL">
    <schema location="../AuditBackEndService.wsdl"/>
    <rootElement name="LogCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090618.1440.5219) AT [WED DEC 02 22:51:43 CET 2009]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"
    xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/SOA-POC/AuditService/AuditBackEndService%2F"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    exclude-result-prefixes="xsi xsl ns xsd top tns plt wsdl xpath20 bpws mhdr oraext dvm hwf med ids xdk xref ora socket">
    <xsl:template match="/">
    <top:LogCollection>
    <top:Log>
    <top:who>
    <xsl:value-of select="/newEventParam/ns:fromUser"/>
    </top:who>
    <top:when/>
    <top:whichClient>
    <xsl:value-of select="/newEventParam/ns:usingClient"/>
    </top:whichClient>
    <top:whichSys>
    <xsl:value-of select="/newEventParam/ns:onSys/@ns:which"/>
    </top:whichSys>
    <top:ipClient>
    <xsl:value-of select="/newEventParam/ns:fromIP"/>
    </top:ipClient>
    <top:wsOperation>
    <xsl:value-of select="/newEventParam/ns:callingWS_Operation"/>
    </top:wsOperation>
    </top:Log>
    </top:LogCollection>
    </xsl:template>
    </xsl:stylesheet>
    Internal WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>AuditBackEndService-OR</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:object-relational-class-mapping-descriptor">
    <opm:class>AuditBackEndService.Log</opm:class>
    <opm:alias>LOG</opm:alias>
    <opm:primary-key>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy">
    <opm:queries>
    <opm:query name="AuditBackEndServiceSelect" xsi:type="toplink:read-all-query">
    <opm:criteria operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="equal" xsi:type="toplink:relation-expression">
    <toplink:left name="whichSys" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="sys" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="greaterThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="fromWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="lessThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="toWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </opm:criteria>
    <opm:arguments>
    <opm:argument name="sys">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="fromWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="toWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    </opm:arguments>
    <toplink:reference-class>AuditBackEndService.Log</toplink:reference-class>
    <toplink:container xsi:type="toplink:list-container-policy">
    <toplink:collection-type>java.util.Vector</toplink:collection-type>
    </toplink:container>
    </opm:query>
    </opm:queries>
    </opm:querying>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.math.BigDecimal</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>who</opm:attribute-name>
    <opm:field table="LOG" name="WHO" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>when</opm:attribute-name>
    <opm:field table="LOG" name="WHEN" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.sql.Timestamp</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichClient</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichSys</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_SYS" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>ipClient</opm:attribute-name>
    <opm:field table="LOG" name="IP_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>wsOperation</opm:attribute-name>
    <opm:field table="LOG" name="WS_OPERATION" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    <toplink:always-refresh>true</toplink:always-refresh>
    </toplink:caching>
    <toplink:remote-caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    </toplink:remote-caching>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:tables>
    <toplink:table name="LOG"/>
    </toplink:tables>
    <toplink:structure>structureName</toplink:structure>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle9Platform</toplink:platform-class>
    <toplink:user-name></toplink:user-name>
    <toplink:connection-url>null</toplink:connection-url>
    </toplink:login>
    </toplink:object-persistence>

  • Migration Issues from Informix to Oracle (datetime format)

    Hello, i am performing a Migration from Informix to Oracle, drive by Migration Workbench, i have an error migrating data from datetime and date fields. I suppose its related by datetime and date format, cause the error tells "Incorrect day or month" when i am migrating data from informix. Targets Oracle database date format is DD/MM/YYYY and source`s Informix database date format like MM/DD/YYYY. Is there any way, in OMW, to specify the mask of datetime or date format to convert date strings from informix to oracle format? Or have i got migrate offline and modify control file to do that with sql*loader?
    How can i do that?
    Example, especify to_date('....', 'MM/DD/YYYY H24:MI:SS') format for migrating informix datetime fields to Oracle.

    The problem i have is, several tables witch contains date and datetime fields, at the same table in informix, by migrating drive by omwb to oracle, the date format i receive from informix at reading is DD/MM/YYYY and datetime format receiving is HH24:MI:SS. Migrating date and datetime types from informix to date, both types to date in oracle, i get an error while matching DD = HH24, MM = MI and YYYY = SS where nls_date_format is DD/MM/YYYY and, the same error matching HH24 = DD, MI = MM and SS = YYYY when nls_date_format is HH24:MI:SS.
    If i set nls_date_format as "DD/MM/YYYY HH24:MI:SS" i get the same error, cause reading data from informix results in data format "DD/MM/YYYY" for date fields and "HH24:MI:SS" for datetime fields.
    I have more than 200 tables in informix with this problem to migrate to oracle, i can solve by migrating offline, modifying datacontrol file to casting to_date format, but over 200 tables, 200 datacontrol files... is there any way for solving that by online migration in omwb?

  • Need help in datetime format.

    hi there,
    currently, i have problem in converting datetime format into this pattern (yyyy-MM-dd).
    I could able to convert it in JSTL which is
    <c:set var="dates"><fmt:formatDate value="${now}" type="DATE" pattern="yyyy-MM-dd"/></c:set>
    <sql:query var="countLeave"
         sql =" SELECT * FROM VCST_EMPLOYEE_LEAVE WHERE CAST(FLOOR(CAST(leave_from AS FLOAT))AS DATETIME) = ? ">
              <sql:param value="${dates}"/>
         </sql:query>
    From the JSTL code above i would like to convert in Java code. I have no idea on how to convert it especially not converting the datetime datatype from MSSQL into String format.
    Is there any way of doing it. Thank you.

    try this
    // Format the current time.
    java.text.SimpleDateFormat formatter
    = new java.text.SimpleDateFormat ("yyyy-MM-dd");
    java.util.Date currentTime_1 = new java.util.Date();
    String dateString = formatter.format(currentTime_1);

  • Number to a datetime format

    I am trying to convert a number and a date field to a date time field and I am having issues.
    COl1 COl2
    11/23/2005 90359
    12/31/2005 123456
    02/03/2006 234534
    I want my output as
    11/23/2005 9:03:59
    12/31/2005 12:34:56
    02/03/2006 23:45:34
    Please let me know...

    Or
    michaels>  with t as
         (select '11/23/2005' col1, '90359' col2 from dual union all
          select '12/31/2005', '123456' col2 from dual union all
          select '02/03/2006', '234534' col2 from dual)
    select to_char(to_date(col1 || lpad(col2,6,0),'MM/DD/RRRRHH24MISS'),'MM/DD/RRRR HH24:MI:SS') x
      from t
    X                 
    11/23/2005 09:03:59
    12/31/2005 12:34:56
    02/03/2006 23:45:34Leave away the final formating TO_CHAR() if you really want a true »datetime« format!
    Message was edited by:
    michaels

  • POI HSSFWorkbook using to read data of datetime format

    Hi
    I am trying to read the drata from excel sheet which contain data as in date format.
    The data is in the datetime format but I am unable to read this data in our jsp page.
    its shows the cell type is of integer type.
    able to read simple date in format yyyy/mm/dd but getting problem in yyyy/mm/dd hh mm format.
    guide me what to to.
    Thanks
    parveen kumar

    Hi
    I am trying to read the drata from excel sheet which contain data as in date format.
    The data is in the datetime format but I am unable to read this data in our jsp page.
    its shows the cell type is of integer type.
    able to read simple date in format yyyy/mm/dd but getting problem in yyyy/mm/dd hh mm format.
    guide me what to to.
    Thanks
    parveen kumar

  • Convert the date of string to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.

    I need convert the date of string format 'MM/dd/yyyy' to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.Since
    I need to search values based on date where my database datetime  is 'MM/dd/yyyy' format.

    In my opinion you should re-consider the assumption that the date picker returns a string. Maybe it is able to return a
    DateTime object directly instead of string. Then you will pass this value as a parameter of SQL query. This should work regardless of computer configuration.
    Otherwise, follow the previous string-based approaches.

  • How to map field with xsd:dateTime dataType?

    Dear friends,
    I need to produce the following output for a field defined as xsd:dateTime.
    2009-02-18T09:53:02.491+01:00
    I tried with a XSLT mapping with a XPATH function "current-dateTime()". However, the XSLT engine of XI doesn't seem to support this XPATH function.
    How can I produce the output according to the XSD datTime datatype?
    Regards,
    Roberto

    Hi
    You can use XSLT runtime constants.
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    Check this link for XSLT date time
    Error in Current Date in XSLT Mapping
    Regards
    Vishnu

  • Trouble with SQL datetime format

    I have written a VI to import a CSV file into a SQL data table but I
    cannot get it to work when using a table with "datetime" data
    format.  It will import into a new table with undefined data
    formats as "varchar" format but no luck when going into a table with the "datetime" data
    format.   I need the datetime format for date/time queries later.
    I have attached a zip file of my VI and the CSV file.  Is there a problem with my CSV format or I am I doing
    something else wrong here?
    Please help.
    Thanks,
    Greg
    Attachments:
    SQL issue.zip ‏54 KB

    Greg
    I have just tried to insert your data into a SQL Server (MSDE) database.
    I found that the INSERT data didn't work. The TRUE for Create Table didn't seem to do any thing. So I created a table using labview like this
    And this is its design.
    I then run the vi again and it starts to work with no issues. So it looks like the Create Table?=TRUE for the INSERT doesn't seem to work on SQL Server. It looks like you need to create the table first.
    Here is your data in the database
    Let me know what you think
    David
    Message Edited by David Crawford on 04-28-2006 11:17 AM
    Attachments:
    Your Data.jpg ‏32 KB
    Create Table.jpg ‏20 KB
    Table Design.jpg ‏15 KB

  • Datetime format - auto colon entering in the time

    In Oracle 6i, the user could enter the date and time without entering a colon, and the colon would automatically populate. In Oracle 10g, this no longer is the case.
    Example:
    datetime format: MM/DD/RR HH24:MI
    User enters: 11/01/07 1900
    In 6i, it would put in the colon. In 10g, it responds with an error. If I use format MM/DD/YY HH24:MI, it puts in a colon, but saves the data as 11/01/0007 19:00.
    Is there a workaround? I found a related document in Metalink (Customer Tar # (Mandatory for Customer Bugs):5711214.992 ), but the workaround did not work.

    A format mask of MM/DD/YY HH24:MI is supposed to give you a year of 0007. RR is the one that has some built-in smarts: >50 gives you 19YY and <=50 gives you 20YY. The recommended format mask is to use four Y's: MM/DD/YYYY HH24:MI You basically force the users to be specific.<BR>
    If there was one lesson we should have all learned from the millennium bug, it was that a year should always be expressed in full. Am I right?<br>
    Can you please try MM/DD/YYYY HH24:MI and tell us what happens?

Maybe you are looking for

  • Setting data type of an object at run time

    This is something of an advanced problem, so I hope there's someone out there who can speak to this. I apologize for the length of the post, I'm just trying to be clear about a rather unclear conundrum. -- We all use arrays to hold collections of thi

  • Creation of Vendor master

    Dear All, I am trying to create Vendor Master by using Tcode: PRAA, here I maintained all infotypes necessary for the employee and I assigned the reference Vendor also but when I executing it it is showing that the employee record is included in file

  • Cannot opening PDF created with Adobe Acrobat 5 on Samsung Android device

    Hi I have an number of links to PDFs on my WordPress.com blog home page (www.creationtonewcreation.com). These were created in Adobe Acrobat 5, with security applied that allows viewing and printing. They open fine on my laptop (e.g. with Google Chro

  • Photos sent from ipad to pc are upside  on the pc

    seems that the photos i send from my ipad via email to pc folks are upside in their emails. what is the problem kathy

  • Can't write on my cd drive

    For the last couple of weeks, I have been unable to write on my cd drive. I can read from them, just not write.   I have tried different cd's, same problem.  I have a HP Pavilion dv2500.  It was loaded with Vista, but I hve since upgraded to Windows