Code example for GregorianCalendar

Methods: format, setTimeInMillis

0
    * @param  t 
    *         timestamp in milliseconds (see {@link java.util.Date#getTime()}). 
    * @return String of the date. 
    */ 
   public static String getDateString(long t) {
      GregorianCalendar gc = new GregorianCalendar();
      gc.setTimeInMillis(t);
      return DateFormat.format("dd.MM.yyyy", gc).toString();
   } 
    
   /** 
    * Returns the app data as json. 
    *  
    * @return {@link org.json.JSONArray JSONArray} 
    */ 
   public JSONArray getJSonData() {
      JSONArray dataList = new JSONArray();
      JSONObject data;
       
      Cursor c = fetchAllEntries(null);