package test;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;

import com.offcn.process.NWN;

public class test  {
    public static void main (String[] args) {

    	String year = getCurrentYear();
    	System.out.println(year);
    }
    
	public static  String getCurrentYear(){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
		Date date = new Date();
		return sdf.format(date);
	}
	//在parameter中获取get请求中的参数
  	public static String getParameter_get(String parameter,String Letter){
  		if(parameter==null){
  			return "";
  		}
  		String[] strcomma=parameter.split("&");
  		int comma=strcomma.length;
  		StringBuffer sb=new StringBuffer();
  		for(int k=0;k<comma;k++){
  			String str_strcomma=strcomma[k];
  			if(str_strcomma.contains(Letter)){
  				int start=str_strcomma.indexOf('=');
  				sb.append(str_strcomma.substring(start+1,str_strcomma.length()));
  				return sb.toString();
  			}
  		}
  		return sb.toString();
  	}
}
