<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Converitng SQL Anywhere's datetime value into java.Util.Date in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829603#M4860446</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;By the way I got solution for the same.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Feel free to tell more about that solution, in case you expect others could learn from that, too:)&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2013 05:27:52 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2013-11-27T05:27:52Z</dc:date>
    <item>
      <title>Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaq-p/13829598</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am exporting the data of any table in which there is field like CREATED_ON whoese datatype is date time.&lt;/P&gt;
&lt;P&gt;While exporting value of the field is &lt;STRONG&gt;2013-11-18 15:37:47.123&lt;/STRONG&gt;
When I am going to convert the above value into java.Util.Date. I am writing following&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;DateFormat&lt;/SPAN&gt; &lt;SPAN class="n"&gt;formatter&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="k"&gt;new&lt;/SPAN&gt; &lt;SPAN class="n"&gt;SimpleDateFormat&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"yyyy-MM-dd HH:mm:ss"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;Date&lt;/SPAN&gt; &lt;SPAN class="n"&gt;date&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;date&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;formatter&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;parse&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;columnValue&lt;/SPAN&gt;&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;System&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;out&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;println&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"yyyy-MM-dd HH:mm:ss "&lt;/SPAN&gt;&lt;SPAN class="o"&gt;+&lt;/SPAN&gt;&lt;SPAN class="n"&gt;date&lt;/SPAN&gt;&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Error is coming due to "15:37:47.123" format malformed.
Because extra value ".123" after HH:mm:ss is giving error.
When I remove the extra &lt;STRONG&gt;".123"&lt;/STRONG&gt; error is gone.&lt;/P&gt;
&lt;P&gt;So any one tell what is this extra value and how can I parse it in same format by giving correct date format.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 05:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaq-p/13829598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-25T05:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829601#M4860444</link>
      <description>&lt;P&gt;Which driver are you using to fetch the data from the server and what data type are you fetching the datetime value as? In other words, are you using jConnect or the SQL Anywhere JDBC Driver and are you fetching the datetime value using getString(), getTimestamp(), ...? If you are using the SQL Anywhere JDBC Driver and you fetch using getTimestamp() then you should be able to convert the java.sql.Timestamp value to a java.util.Date value without issue. If you are fetching as string and have to continue doing so, then you might want to consider temporarily setting the timestamp_format option to not include the fractional seconds when fetching the datetime value. See the documentation on timestamp_format database option. Make sure you use SET TEMPORARY OPTION to when changing the timestamp_format so that you do not mess up other connections.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 08:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829601#M4860444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-25T08:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829602#M4860445</link>
      <description>&lt;P&gt;I am using jconn4 driver to connect the SQL Anywhere and the datatype is datetime. I am making connection using mybatis api so whenever it fetch the data it treat it as util.Date by default and as it is write in csv so when i will read it, it is a string and I want to convert it into util.Date&lt;/P&gt;
&lt;P&gt;By the way I got solution for the same.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 04:14:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829602#M4860445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-27T04:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829603#M4860446</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;By the way I got solution for the same.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Feel free to tell more about that solution, in case you expect others could learn from that, too:)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 05:27:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829603#M4860446</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2013-11-27T05:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829599#M4860442</link>
      <description>&lt;P&gt;I've had the same problem, and it's even more complex because you forgot that a time zone might also be involved.&lt;/P&gt;
&lt;P&gt;Here is my potential solution, in another answered question:  &lt;A href="http://sqlanywhere-forum.sap.com/questions/12272/jdbc-retrieving-timestamp-with-time-zone"&gt;JDBC Retrieving timestamp with Time Zone&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2013 17:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829599#M4860442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-01T17:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converitng SQL Anywhere's datetime value into java.Util.Date</title>
      <link>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829600#M4860443</link>
      <description>&lt;P&gt;This is solution what I got...&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;String&lt;/SPAN&gt; &lt;SPAN class="n"&gt;columnValue&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"2013-11-18 15:37:47.000"&lt;/SPAN&gt;&lt;SPAN class="o"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;DateFormat&lt;/SPAN&gt; &lt;SPAN class="n"&gt;formatter&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="k"&gt;new&lt;/SPAN&gt; &lt;SPAN class="n"&gt;SimpleDateFormat&lt;/SPAN&gt;&lt;SPAN class="o"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"yyyy-MM-dd HH:mm:ss.SSS"&lt;/SPAN&gt;&lt;SPAN class="o"&gt;);&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;Date&lt;/SPAN&gt; &lt;SPAN class="n"&gt;date&lt;/SPAN&gt;&lt;SPAN class="o"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;date&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;formatter&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="na"&gt;parse&lt;/SPAN&gt;&lt;SPAN class="o"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;columnValue&lt;/SPAN&gt;&lt;SPAN class="o"&gt;);&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Dec 2013 07:24:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converitng-sql-anywhere-s-datetime-value-into-java-util-date/qaa-p/13829600#M4860443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-05T07:24:01Z</dc:date>
    </item>
  </channel>
</rss>

