00001 
00002 
00010 
00012 package pkgUtil;
00013 
00014 import java.util.*;
00015 import java.text.*;
00016 import pkgMcj.*;
00017 
00019 public class UtilDate {
00020 
00021    private Mcj mcj;
00022 
00023    private SimpleDateFormat 
00024       strYear = new SimpleDateFormat ("yyyy.MM.dd");
00025 
00026    private SimpleDateFormat 
00027       strMonth = new SimpleDateFormat ("MM-dd hh:mm");
00028 
00029    private SimpleDateFormat 
00030       testYear = new SimpleDateFormat ("yyyy");
00031    
00032 
00033    
00037    public UtilDate( Mcj parent){
00038       mcj = parent;
00039    }
00040    
00041    
00042    
00043    public String getDateString( long value ){
00044       Date objDate = new Date(value); 
00045       Date now = new Date();    
00046       String nowYear = testYear.format(now); 
00047       String objYear = testYear.format(objDate); 
00048 
00049       if( objYear.equals( nowYear.substring(0,4) )){
00050          return strMonth.format(objDate);
00051       }
00052       return strYear.format(objDate);
00053 
00054    }   
00055    
00056 }  
00057