Package java.text

Examples of java.text.SimpleDateFormat


     * This method returns a char from the specified date.
     *
     * @return string of Fdate in local time.
     */
    public static String toLocalDateTime(Date date) {
        return new SimpleDateFormat(localDateTimeFormatString).format(date);
    }
View Full Code Here


import org.springframework.beans.propertyeditors.CustomDateEditor;

public class DefaultDateEditor extends CustomDateEditor {

    public DefaultDateEditor(String dateFormat) {
        super(new SimpleDateFormat(dateFormat), true);
    }
View Full Code Here

    public DefaultDateEditor(String dateFormat) {
        super(new SimpleDateFormat(dateFormat), true);
    }

    public DefaultDateEditor() {
        super(new SimpleDateFormat("dd.MM.yyyy"), true);      
    }
View Full Code Here

  }

  @Test
  public void testStringToDateMapping() throws Exception {
    mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss:SS");
    String dateStr = "01/29/1975 10:45:13:25";
    TestObject sourceObj = newInstance(TestObject.class);
    sourceObj.setDateStr(dateStr);
    TestObjectPrime result = mapper.map(sourceObj, TestObjectPrime.class);
    assertEquals(df.parse(dateStr), result.getDateFromStr());
    assertEquals(dateStr, df.format(result.getDateFromStr()));

    TestObject result2 = mapper.map(result, TestObject.class);
    assertEquals(df.format(result.getDateFromStr()), result2.getDateStr());
    assertEquals(result.getDateFromStr(), df.parse(result2.getDateStr()));
  }
View Full Code Here

    String fmt = null;
    if(locale!=null && "zh".equalsIgnoreCase(locale.getLanguage()))
      fmt = "yyyy��M��d�� EEEEE";
    else
      fmt = "yyyy/MM/dd EEEEE";
    return new SimpleDateFormat(fmt, locale).format(Calendar.getInstance(locale).getTime());
  }
View Full Code Here

   *
   * @param formatter
   * @return
   */
  public String format_now_month(String formatter) {
    SimpleDateFormat sdf = new SimpleDateFormat(formatter, Locale.ENGLISH);
    Calendar cal = Calendar.getInstance();
    cal.set(Calendar.DATE, 1);
    return sdf.format(cal.getTime());
  }
View Full Code Here

        /**
         * Generate an rfc822 date for use in the Date HTTP header.
         */
        public static String httpDate() {
            final String DateFormat="EEE, dd MMM yyyy HH:mm:ss ";
            SimpleDateFormat format=new SimpleDateFormat(DateFormat, Locale.US);
            format.setTimeZone(TimeZone.getTimeZone("GMT"));
            return format.format(new Date()) + "GMT";
        }
View Full Code Here

      throw new TranslatorException(SalesForcePlugin.Util.getString("Util.query.exceeds.max.length")); //$NON-NLS-1$
    }
  }

  public static SimpleDateFormat getSalesforceDateTimeFormat() {
      return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); //$NON-NLS-1$
  }
View Full Code Here

  public static SimpleDateFormat getSalesforceDateTimeFormat() {
      return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); //$NON-NLS-1$
  }
 
  public static SimpleDateFormat getTimeZoneOffsetFormat() {
    return new SimpleDateFormat("Z"); //$NON-NLS-1$
  }
View Full Code Here

  public static SimpleDateFormat getTimeZoneOffsetFormat() {
    return new SimpleDateFormat("Z"); //$NON-NLS-1$
  }

  public static DateFormat getSalesforceDateFormat() {
    return new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of java.text.SimpleDateFormat

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.