[MOBY-dev] Dashboard and date types

José María Fernández González jmfernandez at cnio.es
Mon May 21 07:05:53 UTC 2007


Hi Martin,
	have you taken into account that daylight saving is currently in effect? GMT
and UTC are not the same in that case, because most (if not all) GMT countries
followed the daylight saving change.

But it could be a Java bug, because the standard says that +01:00 is a shift
from UTC. In that case, you could validate that behavior using alternate Date
and Time clases from http://joda-time.sourceforge.net/.

	Best Regards,
		José María

Martin Senger wrote:
> I have fixed the bug reported by Ivan about the wrong format of date/time
> strings produced by jMoby classes. The format, indeed, did not conform with
> the http://www.w3.org/TR/NOTE-datetime standard as required by Biomoby API).
> 
> But doing it I found some unanswered questions. Perhaps mainly for Paul, but
> because the bug was reported here, I am discussing it also here.
> 
> The problem was caused mainly by the fact that the java class
> SimpleDateFormat (a class that is usually used for creating formatted
> strings from the Date objects) produces strings that are not compatible with
> the "http://www.w3.org/TR/NOTE-datetime" standard. Or, at least, I have not
> found a way how to do it (which is the first question: can it be done?
> how?). The lines:
> 
> SimpleDateFormat sdf = new SimpleDateFormat (MobyDateTime.FULL_FORMAT);
> System.out.println (sdf.format (new Date()));
> 
> produces "2007-05-21T00:40:35+0100" which does not comply with he mentioned
> standard (the result that complies should be: "2007-05-21T00:40:35+01:00").
> 
> But because of using SimpleDateFormat is otherwise very convenient, I have
> added a hack into MobyDateTime class that accepts even this non-standard
> format and converts it into a good one (by adding a colon separator). Here
> is the second question: is there a better place or way to replace this hack?
> 
> Last, and actually the main question, is that I suspect a bug in the method
> MobyDataDateTime.getString(calendar). When I feed it with the calendar
> created from the string "2007-05-21T00:40:35+01:00" I will get a string
> "2007-05-21T02:40:35Z". The method removed timezone (and replaced it with a
> single Z letter, which is correct) but the time - that should be now in GMT
> - is now bigger by two hours when I expected decrease by one hour (moving
> from my BST time which is +01 to the GMT). Is this a bug or my
> misinterpretation of the times?
> 
> Cheers,
> Martin
> 

-- 
José María Fernández González
Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 2256)
e-mail: jmfernandez at cnio.es		Fax: (+34) 91 224 69 76
Biología Estructural y Bioinformática	Structural Biology and Bioinformatics
Centro Nacional de Investigaciones Oncológicas
C.P.: 28029				Zip Code: 28029
C/. Melchor Fernández Almagro, 3	Madrid (Spain)


**NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en su caso los ficheros adjuntos, pueden contener información protegida para el uso exclusivo de su destinatario. Se prohíbe la distribución, reproducción o cualquier otro tipo de transmisión por parte de otra persona que no sea el destinatario. Si usted recibe por error este correo, se ruega comunicarlo al remitente y borrar el mensaje recibido.
**CONFIDENTIALITY NOTICE** This email communication and any attachments may contain confidential and privileged information for the sole use of the designated recipient named above. Distribution, reproduction or any other use of this transmission by any party other than the intended recipient is prohibited. If you are not the intended recipient please contact the sender and delete all copies.




More information about the MOBY-dev mailing list