Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change system date

 
Chris Salivar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me if its possible to change the windows system date using java and if yes then how?
TIA
- Chris
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java itself cannot change that type of property. However, if there is some dll which allows you to do it, you can access the methods through JNI.
--Mark
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...or if there is a command line arg you can cann to change the date, you can use Runtime.exec()...
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic