Examples of SimpleDateFormat


Examples of com.dotcms.repackage.com.ibm.icu.text.SimpleDateFormat

          expireUSer = APILocator.getUserAPI().getSystemUser();
        } catch (DotDataException e) {
          Logger.error(this.getClass(), e.getMessage(), e);
          throw new JobExecutionException(e);
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm00");
        String now = sdf.format(new Date());
   
        /*
         * do publish first, where publish is in the past and expire is in the
         * future and live = false
         */
 
View Full Code Here

Examples of com.ibm.icu.text.SimpleDateFormat

  public IValue printDate(IDateTime inputDate, IString formatString)
  //@doc{Print an input date using the given format string}
  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue());
      Calendar cal = getCalendarForDate(inputDate);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time with format " + formatString.getValue(), null, null);
    }
  }
View Full Code Here

Examples of java.text.SimpleDateFormat

      return true;
    if (p.getState().equals("P_D")) {
      Date now = new Date();
      try {
        Date begin =
          new SimpleDateFormat("dd/MM/yyyy").parse(
            p.getMetaData("dateBegin") + "");
        Date end =
          new SimpleDateFormat("dd/MM/yyyy").parse(
            p.getMetaData("dateEnd") + "");
        if (now.after(begin) && now.before(end))
          return true;
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

Examples of java.text.SimpleDateFormat

     * Set the locale for date parsing of listings
     *
     * @param locale    locale to set
     */
    public void setLocale(Locale locale) {
        formatter = new SimpleDateFormat("MM-dd-yy hh:mma", locale);
    }   
View Full Code Here

Examples of java.text.SimpleDateFormat

    m_Values = null;
    m_Hashtable = null;
    m_Header = null;
    m_Type = DATE;
    if (dateFormat != null) {
      m_DateFormat = new SimpleDateFormat(dateFormat);
    } else {
      m_DateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    }
    m_DateFormat.setLenient(false);
    setMetadata(metadata);
  }
View Full Code Here

Examples of java.text.SimpleDateFormat

            setMoveAfterFailure(moveDirectoryAfterFailure);

            String moveFileTimestampFormat = ParamUtils.getOptionalParam(
                    params, VFSConstants.TRANSPORT_FILE_MOVE_TIMESTAMP_FORMAT);
            if(moveFileTimestampFormat != null) {
                moveTimestampFormat = new SimpleDateFormat(moveFileTimestampFormat);
            }

            String strStreaming = ParamUtils.getOptionalParam(params, VFSConstants.STREAMING);
            if (strStreaming != null) {
                streaming = Boolean.parseBoolean(strStreaming);
View Full Code Here

Examples of java.text.SimpleDateFormat

        }
        return false;
    }

      public static String getSystemTime(String dateFormat) {
            return new SimpleDateFormat(dateFormat).format(new Date());
      }
View Full Code Here

Examples of java.text.SimpleDateFormat

  @Test
  public void testDateFormat_CustomMapType() throws Exception {
    // Test that date format works for mapping between String and Custom Map Type
    mapper = getMapper(new String[] { "mapMapping3.xml" });
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    String dateStr = "10/15/2005";
    CustomMap src = newInstance(CustomMap.class);
    src.putValue("fieldA", dateStr);

    org.dozer.vo.SimpleObj dest = mapper.map(src, org.dozer.vo.SimpleObj.class);
    assertNotNull("dest field should not be null", dest.getField5());
    assertEquals("dest field contains wrong date value", df.parse(dateStr), dest.getField5().getTime());

    CustomMap remappedSrc = mapper.map(dest, CustomMap.class);
    assertEquals("remapped src field contains wrong date string", dateStr, remappedSrc.getValue("fieldA"));
  }
View Full Code Here

Examples of java.text.SimpleDateFormat

     * Set the locale for date parsing of listings
     *
     * @param locale    locale to set
     */
    public void setLocale(Locale locale) {
        noHHmmFormatter1 = new SimpleDateFormat("MMM-dd-yyyy", locale);
        noHHmmFormatter2 = new SimpleDateFormat("dd-MMM-yyyy", locale);
        noHHmmFormatter = noHHmmFormatter1;
       
        hhmmFormatters = new ArrayList();
        hhmmFormatters.add(new SimpleDateFormat("MMM-d-yyyy-HH:mm", locale));
        hhmmFormatters.add(new SimpleDateFormat("MMM-dd-yyyy-HH:mm", locale));
        hhmmFormatters.add(new SimpleDateFormat("MMM-d-yyyy-H:mm", locale));
        hhmmFormatters.add(new SimpleDateFormat("MMM-dd-yyyy-H:mm", locale));
        hhmmFormatters.add(new SimpleDateFormat("MMM-dd-yyyy-H.mm", locale));
        hhmmFormatters.add(new SimpleDateFormat("dd-MMM-yyyy-HH:mm", locale));
   
View Full Code Here

Examples of java.text.SimpleDateFormat

     * Set the locale for date parsing of listings
     *
     * @param locale    locale to set
     */
    public void setLocale(Locale locale) {
        dateFormatter = new SimpleDateFormat("MMM-dd-yyyy-HH:mm", locale);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.