Wrox Programmer Forums
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 7th, 2008, 07:09 AM
Authorized User
Join Date: Oct 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hafizmuhammadmushtaq Send a message via Yahoo to hafizmuhammadmushtaq
Default Date in java

i want to creat a Date object and then convert this date object into string.........how can i do this????????

Old April 8th, 2008, 05:00 AM
Friend of Wrox
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts

Date d = new Date(2008,4,8);
String s = d.toString();
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Old April 17th, 2008, 06:42 AM
Registered User
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Date d = new Date(2008,4,8);
String s = String.valueOf(d);

Old April 17th, 2008, 10:37 PM
Posts: n/a

Java have two date classes in my knowledge
java.util.Date and

if u use both packages
u can use like,
 Date d = new java.util.Date(2008,4,8);

`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
problem with java.util.Date kanoorani Java Basics 1 April 20th, 2007 01:48 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Sequencial ID by date Java zaman1111 JSP Basics 7 September 24th, 2004 01:19 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.