1

Anybody know how programmatically change system time and date at linux (ubuntu) by Java ? I'm two days looking for decision for this but not yet find... I tried use Date(), SimpleDateFormat() and Calendar but it doesn't works... Anybody help me? Thanks:)

Leo
  • 97
  • 2
  • 12
  • it doesn't works. ??? what not working ?? – Suresh Atta Apr 25 '13 at 14:16
  • 4
    See this answer http://stackoverflow.com/questions/6203857/how-can-i-set-the-system-time-in-java – realgt Apr 25 '13 at 14:17
  • 2
    You could not find anything because the standard library does not have a method to change system time/date. I bet you will need JNI. – Tadas S Apr 25 '13 at 14:17
  • http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html#exec%28java.lang.String%29 – PeterMmm Apr 25 '13 at 14:19
  • I need change and Set new system Date. For example, i used SimpleDateFormat class - I cganged time, take Print and watch that. But i can't set that new time like system time... – Leo Apr 25 '13 at 14:19

0 Answers0