I am new starter android.
I have simple question. When I choose date through datePickerDialog and press confirm button, I want to store the date as date format instead of string.
How can I store the date format?
private static final String DATABASE_CREATE =
"create table fridge_table (_id integer primary key autoincrement, "+
"category text not null, name texct not null, expired_date text not null);";
public void onCreate(SQLiteDatabase db)
{
db.execSQL(DATABASE_CREATE);
}
How can I change expired_Date field? some of people said using long, or date.
I am wondering how to store in sqlite.
What I am trying to convert date, I want to set the alarm through this field.
Could you help me? and if you have any example, please give me some of example.
You can use Calendar object then.
You can save time like:
You can also retrieve the same using:
For various date format options,visit http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html
EDIT :
For example: