Android Long to Date Convert getYear(long dateTimeMillis)

Here you can find the source of getYear(long dateTimeMillis)

Description

get Year

Declaration

public static int getYear(long dateTimeMillis) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;

public class Main {
    public static int getYear(long dateTimeMillis) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy");
        StringBuilder dateString = new StringBuilder(
                format.format(dateTimeMillis));
        return Integer.parseInt(dateString.toString());
    }/*  www .  j av  a 2s . c  om*/
}

Related

  1. getUTCandRelativeDateFromElapsedTime( long elapsedTime)
  2. getUTCandRelativeDateFromElapsedTime( long elapsedTime)
  3. getUniversalDateStamp(long time)
  4. getUpdateDateStr(long time)
  5. getUpdateTimeStr(long time)
  6. hrColMin(final long time, final boolean alwaysIncludeHours)
  7. hrColMinColSec(final long time, final boolean alwaysIncludeHours)
  8. isAtMostNMonthsAgo(long date, int howMany)
  9. isAtMostNWeeksAgo(long date, int howMany)