• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about SimpleDateFormat  RSS feed

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using SimpleDataFormat to get the current time as the name of my log file, like this:





My question is why the hour and minute is incorrectly:
The name of the file said "17_02_06", but I create the file at 11:01 (from 'ls' result).

Thank you for any idea.
 
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably need to set the time zone. Where are you, and what does this print?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!