2012-04-06 4 views

답변

4

나는 DateBox.Format를 구현하는 클래스 작성하여 이런 짓을 : - 다음

public class MyDateFormat implements DateBox.Format 
{ 

    private TimeZone tz; 

    public MyDateFormat(TimeZone tz) 
    { 
     this.tz = tz; 
    } 

    @Override 
    public String format(DateBox arg0, Date arg1) 
    { 
     if(arg1 == null) 
     { 
      return null; 
     } 
     return DateTimeFormat.getFormat("dd MMM yyyy hh:mm:ss Z").format(arg1, tz); 
    } 

    @Override 
    public Date parse(DateBox arg0, String arg1, boolean arg2) 
    { 
     return DateTimeFormat.getFormat("dd MMM yyyy hh:mm:ss Z").parse(arg1); 
    } 

    @Override 
    public void reset(DateBox arg0, boolean arg1) 
    { 

    } 
} 

과 : -

dateBox.setFormat(new MyDateFormat(tz)); 
관련 문제