@morbiuswilters said:@Wolftaur said:@tster said:I know that you can't tell that he is joking because he used perfect capitalization and punctuation, but it should be clear that it's a joke from the fact that he said it isn't Turing complete because it is interpreted.
I ran out of coffee yesterday, so... I'm missing the should-be-obvious left and right today. :/It's okay, I wasn't making fun of you, but instead the first two commenters who kept suggesting odd SQL workarounds and ignoring your clear statement on sprintf(). Those suggestions reminded me of those queries I keep getting sent:[code]SELECT some_id,some_other_field,convert(char(10),some_date_field,103) registry_date FROM wtf[/code]note that convert() function. I asked why they did it, and the answer was that they wanted to get the yyyyMMdd date format. It seems that they didn't even know about the DateFormat um... formatter:[code]DateFormat format = new DateFormat("yyyyMMdd");[/code][code]
java.sql.Date date = rs.getDate("some_date_field");[/code][code]String formattedDate = format.format(date);[/code]would do the job, and you can also keep the actual date as a Date, instead of a string. Or even better: use a formatting output tag in the jsp itself. Note that these guys already used output-formatting tags for numbers, and failed to notice there's a similar one for dates.