Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Setting the System date
Joined: Sep 19, 2006
Nov 01, 2006 07:09:00
How can i get and set system date? I need to synchronize my system's date/time with that of a server for every 30 minutes. Can you give me this coding?
Joined: Apr 14, 2004
Nov 01, 2006 07:20:00
Get is easy:
Setting it however is not. My guess is you would need to call a native method in the OS to do this (since it is the OS that tells the JVM the current time).
It is sorta covered in the
JavaRanch Style Guide
subject: Setting the System date
Problem inserting a null date into a MDB
compare two dates thru Calendar
Regarding the date obtained using java.util.Date class
How to get tomorrow's date?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013