Here you can find the source of getTimePeriod(Date date)
public static String getTimePeriod(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimePeriod(Date date) { SimpleDateFormat _sdf = new SimpleDateFormat("aa"); String _value = _sdf.format(date); return _value; }//from w ww . ja va 2 s. c o m }