Menu
Question Index
...


Write a program to get the appropriate date object according to given string.

Input (String) Output (Date)
'2013-Jan-18' 'Fri Jan 18 00:00:00 PST 2013'
'2013-January-26' 'Sat Jan 26 00:00:00 PST 2013'
'25/Dec/12' 'Tue Dec 25 00:00:00 PST 2012'
'10/5/12' 'Thu May 10 00:00:00 PDT 2012'
'1/January/12' 'Sun Jan 01 00:00:00 PST 2012'
'8 April 2011' 'Fri Apr 08 00:00:00 PST 2011'

class IdentifyTheDayAndTimeOfTheDate3

{    public static void main(String s[])
    {
        System.out.println("output is: " + dayOfDateAndTime("2013-Jan-18"));

    }


public static Date dayOfDateAndTime(String date) {
Date d = null;
//Write code here to get the appropriate date object according to given string.
return d;
}
}

Doubts

Problems

Topic: Locale Class In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App