comment transformer ce code php sue android
$start_pointage_possible=date("Y-m-d H:i:s", strtotime($date_time_pointage.' +5 Minutes'));
Version imprimable
comment transformer ce code php sue android
$start_pointage_possible=date("Y-m-d H:i:s", strtotime($date_time_pointage.' +5 Minutes'));
A l'aide des classes Calendar puis de SimpleDateFormat tu devrais pouvoir t'en sortir. Notamment, pour l'ajout des 5 minutes sur un objet de type Calendar :Code:myCalendar.add(Calendar.MINUTE, + 5);
En même temps... 5 minutes c'est un truc constant:
Code:
1
2
3
4
5
6
7
8 private static final long FIVE_MINUTES_IN_MS = 5 * 60 * 1000; ... DateFormat dateFormat= new SimpleDateFormat("....."); // traduire le format Date oldDate = dateFormat.parse(dateTimePointage); Date newDate = new Date(base.getTime()+FIVE_MINUTES_IN_MS); String startPointagePossible = dateFormat.format(newDate);