Só olhar na documentação:
http://docs.oracle.com/javase/1.4.2/docs/api/java/sql/Timestamp.html#getTime()
http://docs.oracle.com/javase/1.4.2/docs/api/java/sql/Timestamp.html#getTime()
getTime
public long getTime()
- Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this
Timestampobject.
Se o que vc quer é imprimir a data formatada, dá uma pesquisada em SimpleDateFormat
Em 4 de fevereiro de 2013 09:01, Jonatas Santos <jonatasfazenda@gmail.com> escreveu:
Pessoal,Estou tentando converter um date para Timestamp, mas está retornando um valor muito louco! Estou a uns 2 dias tentando resolver esse problema, ai resolvi apelar para a lista, talvez eu esteja fazendo algo muito errado.Segue:Date dateEnd = evaluation.getEnd_date(); //Mon Feb 04 08:56:05 BRT 2013Timestamp timestamp = new Timestamp(dateEnd.getTime()); //2013-02-04 08:56:05.163long time = timestamp.getTime(); //1359975365163 - Totalmente louco, esse timestamp corresponde à 26/11/65 8:46:03Alguém sabe o que está acontecendo?Abraço!--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário