• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calendar Class

 
Nischal Tanna
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys..
I m having a small probs here..
I require my sysdate to be shown as per s specific timezone and Locale..for eg..
If i require to show the United States time..and also the date..
for eg..i have some code written ..but i m not getting the required answer..
//For indian standard time..
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT+05:30"));
int hour12 = cal.get(Calendar.HOUR_OF_DAY);
System.out.println(hour12);
The same i want for United States..also guys check out the output of the abve code..i guess not a perfect answer ...
neways hoping lot of replies..
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
i think ur code is alright.. i can't figure our any probs with that... only thing is that it is returning hours in 24 hrs format.. if u want it in 12 hr format then istaed of

you should write

and for american time you can write..

i hope i am clear.. for any quesries please revert back..
Thanks
Amit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic