Show us what you tried yourself (JavaRanch is
not a code mill). If you get stuck somewhere, explain exactly what the problem is.
If you don't know how to start on this: Have a look at the API documentation of class java.util.Calendar if there are useful methods that you can use for this.