Java SQL Time Create getYear(String dateTime)

Here you can find the source of getYear(String dateTime)

Description

get Year

License

Apache License

Declaration

public static int getYear(String dateTime) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    public static int getYear(String dateTime) {
        Calendar c = Calendar.getInstance();
        c.setTime(getDateTime(dateTime));
        int year = c.get(1);
        return year;
    }/*from  w  w  w . j a v a2s. com*/

    public static java.util.Date getDateTime(String dateTime) {
        java.util.Date strDate = java.sql.Date.valueOf(dateTime);
        return strDate;
    }
}

Related

  1. getTodayAndTime()
  2. getTomorrowOrderTime()
  3. getUserToServerDateTime(TimeZone timeZone, int dateFormat, int timeFormat, String date, Locale locale)
  4. getWaitTimeout(Connection con)
  5. getYear(String dateTime)
  6. substract(Time thisDeparture, Time firstDeparture)
  7. SumTime(Time t1, Time t2)
  8. sumTimes(String[] timeStrings, DateFormat df)
  9. time2Double(java.sql.Time time)