Need help for making a world-clock.
I have an assignment in my OOP class to make a World Clock containing some special cities etc.
My real question though is how can I implement a standard time (GMT maybe) that actually updates or refresh when ever I start up the program?
If this is possible to implement my idea then was to create the different cities according to GMT and then just add whatever Timezone and DST the following city has.
Re: Need help for making a world-clock.
a new Date object initializes to the current UTC date/time.
You can use the Simple Date format to set a time zone, which you get from TimeZone. Then use it to build your formatted date.
SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");