InterviewSolution
| 1. |
What Is The Epoch Date? |
|
Answer» Within a Java program, you can create a Date object by specifying a year, month, date and optionally, the hour, minute and SECOND as PARAMETERS to the constructor function. You can also create a Date object with no arguments to the constructor, in which case the Date object will contain the current date and TIME. Finally, you can create a Date object by specifying the number of milliseconds since the EPOCH date, which is midnight GMT, January 1st, 1970. The Date class USES the epoch date as a reference point which lets your programs refer to subsequent dates in terms of a single long integer. You cannot set a year before 1970. Within a Java program, you can create a Date object by specifying a year, month, date and optionally, the hour, minute and second as parameters to the constructor function. You can also create a Date object with no arguments to the constructor, in which case the Date object will contain the current date and time. Finally, you can create a Date object by specifying the number of milliseconds since the epoch date, which is midnight GMT, January 1st, 1970. The Date class uses the epoch date as a reference point which lets your programs refer to subsequent dates in terms of a single long integer. You cannot set a year before 1970. |
|