java programs

Tuesday, 14 February 2017

Java program to get current Date and Time

import java.util.Date;
public class datePc
{
public static void main (String[] args)
{
Date today = new Date();
System.out.println(today.toString());
}
}


//output : Wed Feb 15 08:38:00 IST 2017
Posted by Aman at 19:10
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

C Language Programs

Blog Archive

  • ▼  2017 (17)
    • ▼  February (17)
      • Java program using if, else if, else
      • Java program to find odd or even number with ifelse
      • Parsing Strings into Dates
      • Date and time formatting can be done very easily u...
      • Date Formatting Using SimpleDateFormat
      • Java program to get current Date and Time
      • Program is an example of length method.
      • The method determines whether the specified char v...
      • java program for Fibonacci Series
      • java program to sum all array elements and then fi...
      • Java program to enter Roll number, Name and Fee fr...
      • How to write a Java program to input 10 number and...
      • Java program to calculate sum of 10 numbers entere...
      • JAVA Program to display name and salary of an empl...
      • Accessing Instance Variables and Methods
      • Java program to find simple interest
      • First Java Program

About Me

Aman
View my complete profile
Simple theme. Powered by Blogger.