Wednesday, January 21, 2015

JAVA Date

Java Date

July 2014. About this time, summer tutoring sessions will be ending early next month and the fall semester will start also next month. I have spent all this time tutoring in the same college classroom at the same hours, I think, five days a week.

Last month also, I had to take all three of the IC3 examinations: Computing Fundamentals, Key Applications (using Word, Excel, PowerPoint, and Access), and Living Online. It was recommended that I passed them when tutoring how to use a computer and these Microsoft software.

I took one exam a week in three consecutive weeks and had only one week to study for each exam. I passed all three in the first try. So now, I can include in my resume that I have a Certiport IC3 certificate.

Now, back to the future, the Spring 2015 semester had just begun yesterday. And tomorrow, I have to start attending a classroom class in Advanced Java.

So here’s a Java program that tells you how to get a date.

import java.util.Date;
import java.util.Calendar;

class HowToGetADate {
  public static void main(String[] args) {
  Date date;
  Calendar calendar;
  calendar = Calendar.getInstance();
  calendar.set(Calendar.YEAR, 1970);
  calendar.set(Calendar.MONTH, Calendar.JANUARY);
  calendar.set(Calendar.DAY_OF_MONTH, 1);
  date = calendar.getTime();
  System.out.println(date.toString());
  }
}

CYK:
What Java data type cannot be cast into a different data type?
What Date constructor is deprecated in Java?
What Java keyword is not used?

Welcome back class!

John Sindayen

1 comment:

  1. If you want to display date in java we can use this examples and JAVA Date is useful in Online Java Course

    Java Online Training to have project deals with time

    ReplyDelete