Package java.time

Examples of java.time.LocalDateTime.format()


        DateTimeFormatter formatter =
                DateTimeFormatter
                        .ofPattern("MMM dd, yyyy - HH:mm");

        LocalDateTime parsed = LocalDateTime.parse("Nov 03, 2014 - 07:13", formatter);
        String string = parsed.format(formatter);
        System.out.println(string);     // Nov 03, 2014 - 07:13
    }

}
View Full Code Here


                msg += " (yours)";
            status.setText(msg);
            email.setText(pledge.getPledgeDetails().getContactAddress());
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
            LocalDateTime time = LocalDateTime.ofEpochSecond(pledge.getTimestamp(), 0, ZoneOffset.UTC);
            date.setText(time.format(formatter));
            memoSnippet.setText(pledge.getPledgeDetails().getMemo());
        }
    }

    @FXML
View Full Code Here

        } else {
            contactLabel.setText("<unknown>");
        }
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM uuuu HH:mm");
        LocalDateTime time = LocalDateTime.ofEpochSecond(pledge.getTimestamp(), 0, ZoneOffset.UTC);
        dateLabel.setText(time.format(formatter));
        this.project = project;
        this.pledge = pledge;

        // Let the user save their pledge again if it's a serverless project and this pledge is ours.
        LHProtos.Pledge pledgeFor = Main.wallet.getPledgeFor(project);
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.