Setar uma data

6 respostas
A

Pessoal

Parece besta a pergunta, mas deu um branco !

Como eu faco para criar um objeto do tipo Calendar sem pegar a data do sistema ?

Eu nao posso utilizar a data do sistema por nada !

Obrigado

6 Respostas

JimMorrison

ueh… se nao vai pegar a data do sistema entao vai pegar de algum outro lugar… q data vc vai informar??? tah vindo do banco??? tah vindo de onde???

Constructor Summary

GregorianCalendar()

Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.

GregorianCalendar(int year, int month, int dayOfMonth)

Constructs a GregorianCalendar with the given date set in the default time zone with the default locale.

GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute)

Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.

GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second)

Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.

GregorianCalendar(Locale aLocale)

Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.

GregorianCalendar(TimeZone zone)

Constructs a GregorianCalendar based on the current time in the given time zone with the default locale.

GregorianCalendar(TimeZone zone, Locale aLocale)

Constructs a GregorianCalendar based on the current time in the given time zone with the given locale.
mario.fts

também pode cria usando o getInstance() para criar e depois setar uma data qualquer com setTime()

A

A data vem do banco !!

F

Perai mas qual a tua necessidade e tua duvida explica melhor ai pra nos.

Abraços

mario.fts
//Popula o resulset ...
ResultSet rs = statement.executeQuery();

Calendar c = Calendar.getInstance();

c.setTime(rs.getDate("NOME_DO_CAMPO_DATA"));

mas manda a sua necessidade ai pra gente ver se não da pra fazer melhor (sempre dá… :wink: )

A

o problema esta na hora tb que vem do banco e nao so a data !!

Criado 10 de outubro de 2008
Ultima resposta 10 de out. de 2008
Respostas 6
Participantes 4