• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on format method of DateTimeFormatter

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


public String format(TemporalAccessor temporal)
Formats a date-time object using this formatter.
This formats the date-time to a String using the rules of the formatter.

Parameters:
temporal - the temporal object to format, not null
Returns:
the formatted string, not null
Throws:
DateTimeException - if an error occurs during formatting



API says This formats the date-time to a String using the rules of the formatter.Can I know where can I read rules of he formatter and also in what scenarios it throws DateTimeException.Any resources to read will be of great help . I want to improve my confidence of answering date formatting questions.

Thanks,
Veena
 
Marshal
Posts: 28261
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, actually, there's a very large section at the top of the API documentation for DateTimeFormatter which, in great detail, goes into how to build a formatter and what the rules are for each part of the formatter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic