First do the design. (This is not a question about
Java yet.) There are questions, which I'm sure you are asking yourself already. Like...
What does it mean to receive time from a server?
Why should I expect that Google will tell me the time?
And I'm sure there are others. So start by making a list of questions. Remember, you aren't asking programming questions. You need to ask questions about what, exactly, you are supposed to do.