I have a datepicker on my android studio app. The data has successfully shown as date, but in firebase it became a random number. This is my code
Calendar calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MMMM-YYYY");
Date date_minimal;
Date date_maximal;
DatePickerDialog datePickerDialog = new DatePickerDialog(context, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
calendar.set(year, month, dayOfMonth);
tgl_daftar.setText(simpleDateFormat.format(calendar.getTime()));
tgl_daftar_date = calendar.getTime();
database.child("user").push().setValue(new dataUser(
nama,
radioButton.getText().toString(),
jurusan,
tgl_daftar_date.getTime()
When input the data, the date came out as a date like this. screenshot of data in app
But in firebase, it became like this.
I want it to display as a date too in firebase. How do i fix this? Thank you