午前0時から午前12時までの1日を差し引くようにしています。
例:2012-12-14 06:35 am=>2012-12-13
私は機能を実行しました、そしてそれは仕事です。しかし、私の質問は、この場合、他のより良いコードですか?はるかにシンプルで理解しやすい。
public String getBatchDate() {
    SimpleDateFormat timeFormatter = new SimpleDateFormat("H");
    int currentTime = Integer.parseInt(timeFormatter.format(new Date()));
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyyMMdd");
    String Date = dateFormatter.format(new Date());
    if ( 0 <= currentTime && currentTime <= 12){
        try {
            Calendar shiftDay = Calendar.getInstance();
            shiftDay.setTime(dateFormatter.parse(Date));
            shiftDay.add(Calendar.DATE, -1); 
            Date = dateFormatter.format(shiftDay.getTime());
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Log.d("BatchDate:", Date);
    }
    return Date;
}
ありがとう、