Feb 20, 2014

Android stored DateTime in SQLite and display it

  private static final String CREATE_TABLE_OrderHead = "CREATE TABLE "
            + TABLE_OrderHead + "(" + Key_idxOrder + " INTEGER PRIMARY KEY," + col_OrderNum+ " TEXT,"
            + col_CustCodeInv + " TEXT,"
            + col_OrderDate + " long,"
            + col_Uploaded + " INTEGER)";

Stored the date time as second
long milisecond = OrderDate.getTime());

Get it and convert to date string

String OrderDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date(obj.getOrderDate()));
 holder.OrderDate.setText(OrderDate);

0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib