Example usage for java.time.format TextStyle FULL_STANDALONE

List of usage examples for java.time.format TextStyle FULL_STANDALONE

Introduction

In this page you can find the example usage for java.time.format TextStyle FULL_STANDALONE.

Prototype

TextStyle FULL_STANDALONE

To view the source code for java.time.format TextStyle FULL_STANDALONE.

Click Source Link

Document

Full text for stand-alone use, typically the full description.

Usage

From source file:Main.java

public static void main(String[] args) {
    DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendLiteral("New Year in ")
            .appendValue(ChronoField.YEAR).appendLiteral(" is  on  ")
            .appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL_STANDALONE).toFormatter();
    LocalDate ld = LocalDate.of(2014, Month.JANUARY, 1);
    String str = ld.format(formatter);
    System.out.println(str);/* w w  w . j  a  va 2 s  .  c  o m*/

}