This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of TensorFlow 2.0 in Action and have Thushan Ganegedara on-line!
See this thread for details.
Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Question on format method of DateTimeFormatter

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • 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: 25963
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic