Core Java-java.util.date

Core Java-java.util.date

View Answers

November 23, 2008 at 10:54 PM

Hi friend,

import java.util.*;
import java.text.*;
public class StringToDate {
public static void main(String[] args) {
try { String str_date="24-NOV-08";
DateFormat formatter ;
Date date ;
formatter = new SimpleDateFormat("dd-MMM-yy");
date = (Date)formatter.parse(str_date);
System.out.println("Today is " +date );
} catch (ParseException e)
{System.out.println("Exception :"+e); }

}
}

For more information on Java Conversion Visit to :

http://www.roseindia.net/java/java-conversion/

Thanks

Vineet









Related Tutorials/Questions & Answers:
Core Java-java.util.date - Java Beginners
Core Java-java.util.date   How we can convert string to Date  ...); } } } For more information on Java Conversion Visit to : http://www.roseindia.net/java/java-conversion/ Thanks Vineet
Jsp Core
Jsp Core   
Advertisements
core java
core java  how to display characters stored in array in core java
Core Java
Core Java  what is a class
CORE JAVA
CORE JAVA  CORE JAVA PPT NEED WITH SOURCE CODE EXPLANATION CAN U ??   Core Java Tutorials
core java
core java  basic java interview question
core java
core java  surch the word in the given file
CORE JAVA
CORE JAVA  What is called Aggregation and Composition
core java
core java  Hi, can any one expain me serialization,Deseralization and exterenalization in core java
core java
core java  Hi, can any one exain me the concept of static and dynamic loading in core java
core java
core java  i need core java material   Hello Friend, Please visit the following link:ADS_TO_REPLACE_1 Core Java Thanks
Springs Core
Springs Core  what is form backing object in springs core
core java
core java  how can we justify java technology is robust
core java
core java  what is the use of iterator(hase next
core java
core java  please give me following output
Core java
Core java  difference between the string buffer and string builder
Core JAva
Core JAva  how to swap 2 variables without temp in java
Core Java
Core Java  What is the significance of static synchronized method? Why do we have the method declared as static synchronized
core java
core java  how to compare every character in one string with every character in other string
core java
core java  write a java program to view product details from product table
core java
core java  what is the max size of array?   You can declare up to maximum of 2147483647
Core Java
Core Java  Write a Program to add given number of days to the current system date and display the same
Core Java
Core Java  How to execute cmd command through java?? Give Code of them
Core Java
Core Java  have to find the prime numbers which is less than the current prime numbers using loops
core java
core java  its compulsory to save file name and class name is same in java
core java
core java  can i use native keyword with abstract method ? if yes explain and if no please explain
core java
core java  Hi, Can any one please share a code to print the below: 1 121 12321 1234321
CORE JAVA
CORE JAVA  Tell me some Scenarios why you go for Abstract Class and Interface
CORE JAVA
CORE JAVA  What is Garbage collection in java? What is the role of a developer for garbage collection
Core java
Core java  how to convert reverse of String without using String function
core java
core java  Is it possible to create a shallow copy of an arraylist instance? if yes then please post the code
Version of servicemix-core>servicemix-core dependency
List of Version of servicemix-core>servicemix-core dependency
Version of activemq-core>activemq-core dependency
List of Version of activemq-core>activemq-core dependency
Version of gj-core>gj-core dependency
List of Version of gj-core>gj-core dependency
Version of openejb-core>openejb-core dependency
List of Version of openejb-core>openejb-core dependency
core java
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
core java
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
core java
core java  readLine() function is realated to which class?   readLine() is a method of java.io.Console class it is also available in java.io.BufferedReader.
core java
core java  what is difference between specifier and modifier? what is difference between code and data? what is difference between instance and object
core java
core java  In java primitive variables will get its default value automatically after declaration. Then why it is mandatory to initialize a variable before using
Core Java
Core Java  Please write a Java Program to design login form and store the values in file & validate and display the MainForm
core java
core java  public class Check { public static void main(String[] args) { System.out.println(11^2); } } how it is work???? plzz explain
Core Java
Core Java  Hi, Can any one please share the code for Binary search in java without using builtin function
Core Java
Core Java  Hi, Can any one please share a code to print the below: 1 23 456 78910 thanks a lot in advance
core java
core java  public static void main(String k[]) Is it possible to pass the Integer type arr instead of String type in main method?(replacing String than Integer) if possible.. how to write code
core java
core java  Create a class containing the main method and define an integer array x of length n=5 to find and display their mean. Mean=?Xi/n
core java
core java  Create a class containing the main method and define an integer array x of length n=5 to find and display their mean. Mean=?Xi/n
core question
core question  can we override or overload static methods   Hi Friend, We can overload static methods but we cannot override static methods.ADS_TO_REPLACE_1 Thanks
Core Java
Core Java  Write a program to read the below data from a file and check whether the period is partial or full month? 03/01/2011 â?? 03/28/2011 03/01/2011 â?? 03/31/2011 02/01/2011 â?? 02/28/2011 02/01/2011 â?? 03/01/2011
Core Java
Core Java  Write a program to accept the given date in DD/MM/YYYY format and convert the same based on user selection mentioned below? 1.MM/DD/YYYY format 2.YYYYMMDD format

Ads