Record time in android studio

0

I'm doing a Qr scanner application, I already have the scanner encoded, what I want to do is scan a code, register the current time automatically in which the scanner was made, use sq lite to record data, If someone could help me, I would appreciate it very much.

    
asked by German Silva 05.10.2018 в 08:43
source

1 answer

0

One way to get the date is with SimpleDateFormat , the format you pick according to the one you have in your field of the database ( date or datetime ).

SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
String currentDateandTime = simpleDateFormat.format(new Date()); 
    
answered by 05.10.2018 / 09:48
source