Util.java :  » Web » jtrimet » jtrimet » Android Open Source

Android Open Source » Web » jtrimet 
jtrimet » jtrimet » Util.java

package jtrimet;

import java.util.*;

public class Util 
{
  
  static public Calendar getCalendar(long time)
  {
    Calendar c = Calendar.getInstance();
    c.setTimeInMillis(time);
    
    return c;
  }

  static public String getDateText(Calendar c)
  {
    if (c == null)
    {
      return "";
    }
    else
    {
      return getDateText(c.getTimeInMillis());
    }
  }
  
  static public String getDateText(long time)
  {
    Calendar c = getCalendar(time);
    
    if (c.get(Calendar.YEAR) < 2005)
    {
      return "unknown";
    }
    else
    {
      return c.getTime().toString();
    }
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.