Package com.ikanow.infinit.e.data_model.utils

Examples of com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat


      // - YYYY    ... (default age-out: 3 years)
     
      String dateStr = m.group(2);
      Date indexDate = null;
      long periodInMs = -1;
      ThreadSafeSimpleDateFormat dateFormatter = new ThreadSafeSimpleDateFormat("yyyy.MM.dd");
      try {
        indexDate = dateFormatter.parse(dateStr);
        if (-1 == ageOutTime) { // (ie not overridden)
          ageOutTime = AGE_OUT_TIME_DAYS; // (default)
        }
        periodInMs = 3600L*24L*1000L; // (24h)
      }//TESTED
View Full Code Here


  protected static class DateSerializer implements JsonSerializer<Date>
  {
    @Override
    public JsonElement serialize(Date date, Type typeOfT, JsonSerializationContext context)
    {
      ThreadSafeSimpleDateFormat tsdf = new ThreadSafeSimpleDateFormat("MMM d, yyyy hh:mm:ss a 'UTC'");
      return new JsonPrimitive(tsdf.format(date));
    }
View Full Code Here

    @Override
    public JsonElement serialize(Date date, Type typeOfT, JsonSerializationContext context)
    {
      Date d = (Date)date;
      if (null == _format) {
        _format = new ThreadSafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
        _format.setCalendar(new GregorianCalendar(new SimpleTimeZone(0, "UTC")));
      }
      JsonObject jo = new JsonObject();
      jo.addProperty("$date", _format.format(d));
      return jo;
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.