Android Day Get getWeatherDateStr(int day)

Here you can find the source of getWeatherDateStr(int day)

Description

get Weather Date Str

Declaration

public static String getWeatherDateStr(int day) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    private static final String WEATHER_DATE_FORMAT = "MM-dd";

    public static String getWeatherDateStr(int day) {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                WEATHER_DATE_FORMAT);//from  w w w.  j av  a  2  s.co  m
        if (day == 0) {
            return dateFormat.format(calendar.getTime());
        } else {
            calendar.roll(Calendar.DAY_OF_YEAR, day);
            return dateFormat.format(calendar.getTime());
        }
    }
}

Related

  1. getDay(long dateTimeMillis)
  2. getDaySelect(String selectName, String value, boolean hasBlank)
  3. getDaySelect(String selectName, String value, boolean hasBlank, String js)
  4. getCurrentDay()
  5. getSmartDateString(long time, String extString, String zeroDayString)
  6. getArrayDiffDays(String startDate, String endDate)
  7. getIndexDay(Date origin, int index)
  8. getDateOfLastSunday(Date d)
  9. getStartNextDay(Date d2)