Package org.joda.time

Examples of org.joda.time.LocalDateTime.toDate()


                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof LocalDateTime) {
                LocalDateTime value = (LocalDateTime) valueAsObj;
                Date date = value.toDate();
                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof DateTime) {
                DateTime value = (DateTime) valueAsObj;
View Full Code Here


                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof DateTime) {
                DateTime value = (DateTime) valueAsObj;
                Date date = value.toDate();
                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
           
            // number
View Full Code Here

    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here

    return generateKey();
  }
 
  public static String generateKey() {
    LocalDateTime dateTime = new LocalDateTime(2012, 6, 1, 0, 0);
    long baseTime = dateTime.toDate().getTime();
    long current = System.currentTimeMillis() - baseTime;
    current = (current * 10000);
    long time = generateKeyImpl(current);
    String encodedTime = Long.toString(time, 36).toUpperCase();
    return encodedTime+"."+HOST_NAME;   
View Full Code Here

                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof LocalDateTime) {
                LocalDateTime value = (LocalDateTime) valueAsObj;
                Date date = value.toDate();
                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof DateTime) {
                DateTime value = (DateTime) valueAsObj;
View Full Code Here

                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
            if(valueAsObj instanceof DateTime) {
                DateTime value = (DateTime) valueAsObj;
                Date date = value.toDate();
                setCellValueForDate(cell, date, dateCellStyle);
                return;
            }
           
            // number
View Full Code Here

    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here

    @Override
    void apachePOI(POICell cell, Object value) {
      if (value != null) {
        LocalDateTime val = (LocalDateTime) value;
        cell.setCellType(Cell.CELL_TYPE_NUMERIC);
        cell.setCellValue(val.toDate());
      }
    }

  }
View Full Code Here

    }

    public Date getLocalNow(TimeZone zone){
        final LocalDateTime now = new LocalDateTime(forTimeZone(zone));

        return now.toDate();
    }

    public Date getBeginningOfLocalDay(TimeZone zone){
        final LocalDateTime now = new LocalDateTime(forTimeZone(zone));
View Full Code Here

    public String todayAsBindingValue(TimeZone originTimeZone, DateTimeBinding binding){
        final DateTimeZone zone = DateTimeZone.forTimeZone(originTimeZone);
        final LocalDateTime today = new LocalDateTime(zone);

        return BindingUtils.dateAsBinding(today.toDate(), binding.serviceFormatMask);
    }

    private static DateTimeZone forTimeZone(TimeZone zone){
        return DateTimeZone.forTimeZone(zone);
    }
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.