I know I can get the date from a datepicker using the following methods:
- datepicker1.getDayOfMonth()
- datepicker2.getMonth()
- datepicker3.getYear()
I am also getting the time from a timepicker using the following methods:
- timepicker1.getCurrentHour()
- timepicker2.getCurrentMinute()
I need to format this data into "yyyy-MM-dd HH:mm:ss" format to place it into an sqlite database as a DATETIME variable. Is there a method which can handle this?
I think I will have to build it manually like so:
if(month < 10){
month = "0" + month;
}
if(day < 10){
day = "0" + day ;
}
The problem was that the months and days were single digit.