Share on Google+Share on Google+

Shivali
Core Java-java.util.date
1 Answer(s)      8 years ago
Posted in : Java Beginners

Ads

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  i need core java material   Hello Friend, Please visit the following link: Core Java Thanks
CORE JAVA
CORE JAVA  What is called Aggregation and Composition
core java
core java  surch the word in the given file
core java
core java  basic java interview question
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  how to swap 2 variables without temp in java
Core java
Core java  difference between the string buffer and string builder
core java
core java  please give me following output
core java
core java  what is the use of iterator(hase next
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  Is it possible to create a shallow copy of an arraylist instance? if yes then please post the code
Core java
Core java  how to convert reverse of String without using String function
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  Hi, Can any one please share a code to print the below: 1 121 12321 1234321
core java
core java  can i use native keyword with abstract method ? if yes explain and if no please explain
core java
core java  its compulsory to save file name and class name is same in java
Core Java
Core Java  have to find the prime numbers which is less than the current prime numbers using loops
Core Java
Core Java  How to execute cmd command through java?? Give Code of them
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  what is the max size of array?   You can declare up to maximum of 2147483647
core java
core java  write a java program to view product details from product table
core java
core java  how to compare every character in one string with every character in other string
Core Java
Core Java  What is the significance of static synchronized method? Why do we have the method declared as static synchronized
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads