0

Hi,

I want to know how can I capture the system date using a java program. I want to run this code automatically when the system is login. I want to capture the system date even if the user change the system date.
Kindly waiting for your suggestions

Thanking You
ani

6
Contributors
7
Replies
8
Views
10 Years
Discussion Span
Last Post by anibio
0

Directly from the API doc for Calendar class...

Like other locale-sensitive classes, Calendar provides a class method, getInstance, for getting a generally useful object of this type. Calendar's getInstance method returns a Calendar object whose calendar fields have been initialized with the current date and time: Calendar rightNow = Calendar.getInstance();

0

just read the api's on Date or Calendar. Or look for "system date + java" in google, you should find all you need

0

Simply you should construct a date object and add it in the method main

public

Edited by happygeek: fixed formatting

0

thnak you all.

I want to run this program automaticaly. That means if the system is login then this program execute and when the system is shutting down this program want to run again.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.