Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do something like 5 minutes before now in GWT

 
peter tong
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As GWT has no Calendar Class as in java, I search and found there is a CalendarUtil in GWT, but it has only

and


but no any method for handling adding or subtracting hours, minutes, seconds, so how to do something like
5 minutes before current times, 1hour before current times...etc?

 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


may be you can use this..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No!
The Timer or the schedule method cannot be used to manipulate the date/time
 
Daniel Renner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe its easier to get the necessary Time/Date with a RPC? So you can use any java function on the server. Or is this not possible/wanted in this case?

Greetings
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter, why don't you just use the methods of Date class. I think using setTime & getTime, you can achieve the needful.

Thanks
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!