On 03.08.2009 18:24, Martin Wittemann wrote: > Hello Alexander, > you are supplying the date format during the creation of the > DateFormat object: > "yyyy-MM-dd" > > Thats why your > '2008-12-08 15:17:51.289' > is not fitting the date format. Something fitting would look like this: > '2008-12-08' > > Setting the format to > "yyyy-MM-dd HH:mm:ss.SSS" > should fix your problem. > > Cheers, > Martin > > Yes, Martin, that will work. I'm pointing that Java analogue works differently:
public static void main(String[] args) throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse("2008-12-08 15:17:51.289"); System.out.println("date = " + date); } produces date = Mon Dec 08 00:00:00 EET 2008 And, without any warnings, not to say about fatal errors. Will you mark this as a bug, or not? The power of java implementation of parser - any date formatted as "yyyy-MM-dd" plus anything else, can be parsed just fine. So I can use one formatter with different SQL types, as Date, Timestamp, etc. extracting only needed part. > Am 03.08.2009 um 17:11 schrieb A.Yerenkow: > > >> Hello guys! >> I'm trying to use a >> var dateFormat = new qx.util.format.DateFormat("yyyy-MM-dd"); >> and trying to parse a string, but I get an error: >> >> message: Date string '2008-12-08 15:17:51.289' does not match the date >> format: yyyy-MM-dd >> >> On my Java back-end this works just well. >> In your docs, there are a note: >> >> parse(String dateStr) >> Parses a date. >> Uses the same syntax as the SimpleDateFormat class in Java. >> >> Only syntax? Or logic as the SimpleDateFormat too? >> >> Any help, how I should normalize all strings which can be dates, >> timestamps, etc, to something which can be parsed by >> qx.util.format.DateFormat? >> >> -- >> Best Regards >> Alexander Yerenkow, >> Generalissimo of UCT >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and >> focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> qooxdoo-devel mailing list >> qooxdoo-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > -- Best Regards Alexander Yerenkow, Generalissimo of UCT ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel