I need to get the current time (as displayed on the system) in my program and schedule a task to run at a particular time everyday.... I heard in java the time is displayed by UTC Time.... Will it not be possible to get the local time?
Maya sekar wrote:I heard in java the time is displayed by UTC Time....
That's not true. You can display the time in any timezone you like.
You get the current time by simply creating a new java.util.Date object. You can format it as you like with a SimpleDateFormat. By default it will use the local timezone of your computer, but you can tell the SimpleDateFormat object to display it in any other timezone.