Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.131
  HXTT Cobol 5.0.131
  HXTT DBF 7.1.132
  HXTT Excel 6.1.135
  HXTT Json 1.0.103
  HXTT Paradox 7.1.131
  HXTT PDF 2.0.131
  HXTT Text(CSV) 7.1.131
  Buy Now
  HXTT Word 1.1.131
  HXTT XML 4.0.132
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

Date detection not consistant
Robert McGlade
2008-02-11 08:16:24.0
Hello, your driver does date detection for odbc based schema where the standard def is not known i.e (in the scema.ini)
C1 Date could be many formats

so I have a situation like this:

13/03/2005 will be detected as dd/MM/yyyy (13th of March 2005)
06/02/2005 will be detected as MM/dd/yyyy (should 6th of February 2005 but is coming back as 2nd of June 2005)

both should be dd/MM/yyyy

is there a way we can tell the driver what the format of a date column should be? maybe something on the url connection string

many thanks

Re:Date detection not consistant
HXTT Support
2008-02-13 16:08:03.0
v4.0.016 provides dateFormate, timeFormat and timestampFormat connection property to specify the default parse sequence of date, time, and timestamp formats. For instance, jdbc:csv://///textfiles?_CSV_Separator=\t;csvfileExtension=TXT;dateFormat=dd/MM/yyyy . That latest package will be released after about 48 hours.

BTW, the old DATE [(dateFormat)] | TIME [(dateFormat)] | TIMESTAMP [(dateFormat)] in CREATE TABLE sql can still be used to assign a different parse mode for a specific. For instance, you have a abc.efg file which contains some data line like "name2 city2 20030806|115441|2003/08/06 115441.324\r\n", you can use "CREATE TABLE if not exists 'abc.efg' (name varchar(25), city varchar(20),logindate date ('yyyyMMdd|'),logintime time ('hhmmss|'),logintimestamp timestamp ('yyyy/MM/dd hhmmss.SSS'),_StuffedColumn char(2) default '\r\n');". You should see java.text.SimpleDateFormat in Java API document to know more details about date-time formatting.

Search Key   Search by Last 50 Questions


Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap