Package java.time

Examples of java.time.LocalDateTime.toLocalDate()


        try (PersistenceSession session = persistenceManager.createSession()) {
            JavatimeConvertEntity inst = new JavatimeConvertEntity();
            inst.setId(99);
            OffsetDateTime dt = OffsetDateTime.ofInstant(new Date().toInstant(), ZoneOffset.of("+0200"));
            LocalDateTime ldt = dt.toLocalDateTime();
            LocalDate ld = ldt.toLocalDate();
            inst.setDateTime(dt);
            inst.setLocalDate(ld);
            inst.setLocalDateTime(ldt);
            session.insert(inst);
View Full Code Here


                        moveMessages(msgs, source, getFolder(rule.getDestFolder(), Folder.READ_WRITE));
                    }
                } else if (rule.getOlderThan() > 0) {
                    LocalDateTime day = LocalDateTime.now().minusDays(rule.getOlderThan());
                    SentDateTerm term = new SentDateTerm(ComparisonTerm.LE,
                            Date.from(day.toLocalDate().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
                    Message[] msgs = source.search(term);
                    if (msgs != null && msgs.length > 0) {
                        deleteMessages(msgs, source);
                    }
                }
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.