db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrnap <my...@Golux.Com>
Subject Re: Date formatting with Network Server
Date Fri, 14 Jan 2005 03:25:04 GMT
Army wrote:

> Question regarding date formatting in the Network Server:
>     System.out.println(java.sql.Date.valueOf("0001-01-01"));

> So my question is three-fold:
> 1) The Java definition for java.sql.Date.toString() says: "Formats a 
> date in the date escape format yyyy-mm-dd".  So as far as I can tell, 
> this means that, with the current implementation, the format 
> yyyy-mm-dd will always be used, regardless of locale.  Is that right?  
> And is that _acceptable_??
> 2) If the answer to #1 is "Yes", then is it safe to replace the 
> "writeString" call above with the following?
>     SimpleDateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd");
>     writer.writeString(df.format((java.sql.Date) val));
> Or is there some reason why we need to avoid using SimpleDateFormat?


I'm only responding that that last line...:

Well -  we should try to avoid using java.text.* because those classes 
are not JSR169 complient...
Not that we are at the moment - as you found.  I've been meaning to work 
on creating replacement classes but other things always seem to push to 
the front...


View raw message