Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Steven Wood   on Apr 09 In Java Category.

  
Question Answered By: Elisabeth Bell   on Apr 09

for example :
.
.
.
Calendar cld = Calendar.getInstance();
Timestamp geldegtar = rs.getTimestamp(new String(myDate));
if (geldegtar == null)
{
Calendar rightNow = Calendar.getInstance();
rightNow.set(1900, 0, 0);
java.util.Date mydate = rightNow.getTime();
long long_mydate = mydate.getTime();
geldegtar = new java.sql.Timestamp(long_mydate);
}
d = new Date(geldegtar.getTime() + (geldegtar.getNanos() /
1000000));
cld.setTime(d);
and then just use cld...
for axample;
int isaat = cld.get(Calendar.HOUR_OF_DAY);
int idak = cld.get(Calendar.MINUTE);
int isaniye = cld.get(Calendar.SECOND);

.
.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on getInstance Method of Calendar Class Or get search suggestion and latest updates.


Tagged: