Java SQL Date Get getDateParameter(java.sql.Date date, int param)

Here you can find the source of getDateParameter(java.sql.Date date, int param)

Description

get Date Parameter

License

Apache License

Declaration

public static int getDateParameter(java.sql.Date date, int param) 

Method Source Code

//package com.java2s;
/**/*from  ww  w  . j  ava2  s.  c  o m*/
 * Copyright (c) 2013-2015 www.javahih.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */

import java.util.Calendar;

public class Main {
    public final static Calendar cal = Calendar.getInstance();

    public static int getDateParameter(java.sql.Date date, int param) {
        if (date == null) {
            return -1;
        }
        cal.setTime(new java.util.Date(date.getTime()));

        return cal.get(param);
    }
}

Related

  1. getDateISO(final String sDate)
  2. getDateNextMonth(java.util.Date current)
  3. getDateOfShortStr(String dateStr)
  4. getDateOfString(long time, String patten)
  5. getDateOrTime(int colType, Object o)
  6. getDatePath(java.sql.Timestamp fileDate)
  7. getDatePath(java.util.Date fileDate)
  8. getDateStart(Date date)
  9. getDateTwo(Date date)