[MOBY-dev] MobyDateTime.FULL_FORMAT problem in jMoby
Iván Párraga García
ivanp at mmb.pcb.ub.es
Wed Apr 4 18:13:43 UTC 2007
Hi,
As long as I understand, the static constant attribute in class
MobyDateTime.FULL_FORMAT should be used to construct the
SimpleDateFormat to use it to format dates. Something like this:
...
import java.text.SimpleDateFormat;
import java.util.Date;
...
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat(MobyDateTime.FULL_FORMAT);
sdf.format( now );
...
But this produces an exception when trying to build the
SimpleDateFormat. I've inspected the content of the constant and it is
like this:
"yyyy-MM-dd\'T\'HH:mm:ss\'Z\'Z"
Instead of it I used the following (I know I'm losing some precision)
and it worked:
"yyyy-MM-dd'T'HH:mm:ss"
Cheers,
--
------------------------------------------------
Iván Párraga García
Computer Scientist
Molecular Modelling & Bioinformatics Unit
INB - Instituto Nacional de Bioinformática
Josep Samitier 1-5
08028 Barcelona
Spain
tel.: +34 93 403 71 55
fax.: +34 93 403 71 57
e-mail: ivanp at mmb.pcb.ub.es
group page: http://mmb.pcb.ub.es
pgp key: http://mmb.pcb.ub.es/~ivanp/pubkey.asc
------------------------------------------------
More information about the MOBY-dev
mailing list