You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActiveAndroid supports serializing Date fields automatically. It is stored internally as a timestamp (INTEGER) in milliseconds.
@Column(name = "timestamp", index = true)
private Date timestamp;
Create a Util method to convert String to Date, if you want:
public Date getDateFromString(String selectedDate) throws ParseException{
DateFormat format = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
Date date = format.parse(selectedDate);
return date;
}
ps. ActiveAndroid has a pretty strong community on Stack Overflow, so you're welcome to ask your questions there. Actually this answer is copied from the Stack Overflow.
@column(name = "timestamp", index = true)
private Date timestamp;
Or
@column(name = "created_at")
private String created_at;
Should i use String or Date .... Can i have example of how to insert date into sqlite properly ! Thankyou
The text was updated successfully, but these errors were encountered: