Can I suppress formatting in getDate()?
843859May 5 2006 — edited May 5 2006I'm getting a "Date" by using the getDate() method. That's fine. What's not fine is that when I display the date on a web page (using c:out) I get a date with dashes in it. So instead of 20070601, I see "2007-06-01". That's problem because you can't go the other way. You have to stip out the dashes in order to create a GregorianCalendar in order to make a java.sql.Date to do an update to the row. I can strip them out at update time, but I'd like to know two things. First, do the dashes only show up when the java.sql.Date is printed, so that if I could look at its raw representation there wouldn't be dashes? Second, is there a way to suppress this "assistance" of putting in dashes when the java.sql.Date is displayed? If it is internally 20070601, I want it to display as "20070601" and never "2007-06-01". Can I do this when I first do a getDate()? Thanks.
Ken