• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DateFormat

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Can some one explain what's happening in the last line of the code.

System.out.println(df.format(d1));

df is accessing the contents of the array and formattting it( I think)
But what is the use of d1 being passed into the format method.

I am finding this Chapter really boring.Wonder if I am the only one..
What exactly are we supposed to know in it.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nabila Mohammad:
But what is the use of d1 being passed into the format method.


because for apply different date format you need to passed date Object.
see JavaDocs format method of DateFormatclass.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic