I need to retrieve day year and month from a timestamp object as long numbers:
public long getTimeStampDay()
{
String iDate = new SimpleDateFormat("dd/MM/yyyy")
.format(new Date(born_date.getDate()));
.....
return day; //just the day
}
public long getTimeStampMonth()
{
String iDate = new SimpleDateFormat("dd/MM/yyyy")
.format(new Date(born_date.getDate()));
.....
return month; //just month
}
public long getTimeStampYear()
{
String iDate = new SimpleDateFormat("dd/MM/yyyy")
.format(new Date(born_date.getDate()));
.....
return year; //just year
}
born_date
is a timestamp object.
Is it possible to do that?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…