Code Comments
Programming Forum and web based access to our favorite programming groups.How do we convert convert the String to a date using the DateFormat Class for e.g Converting the String dateofbirth to a date
Post Follow-up to this messageStefan Waldmann wrote: > ( @Rodey Green: SCNR ;-) Oops, misspelt your name, sorry Roedy :-( (Not a native speaker...)
Post Follow-up to this messageStefan Waldmann wrote: > ( @Rodey Green: SCNR ;-) Oops, misspelt your name, sorry Roedy :-( (Not a native speaker...)
Post Follow-up to this messageI still can't figure it out, Can u give the link to the code direclty or type it here plz, "Stefan Waldmann" <stefan.k.waldmann@vr-web.de> wrote in message news:2l4qm5F8m36oU1@uni-berlin.de... > Java wrote: Class > > Using DateFormat#parse(String dateofbirth) > > <http://java.sun.com/j2se/1.4.2/docs...rmat.html#parse(jav a.lang.String)> > > First create a DateFormat object with the pattern that tells in what > format your date is contained in the string
Post Follow-up to this messageJava wrote: > I still can't figure it out, Can u give the link to the code direclty or > type it here plz, You can find code samples at the URL I posted in my other reply: http://mindprod.com/jgloss/calendar.html Hope that helps.
Post Follow-up to this messageJava wrote:
> I still can't figure it out, Can u give the link to the code direclty or
> type it here plz,
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.ParseException;
public class DateTest
{
public static void main(String[] args)
{
String dateOfBirth = "1974-31-12";
SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-mm-dd");
try {
Date birthday = dFormat.parse(dateOfBirth);
System.out.println(birthday);
System.out.println(dFormat.format(birthday));
}
catch(ParseException ex) {
ex.printStackTrace();
}
}
}
Post Follow-up to this messageOn Thu, 8 Jul 2004 15:25:43 +0400, "Java" <Dhanesh81@intnet.mu> wrote or quoted : >How do we convert convert the String to a date using the DateFormat Class > >for e.g > Converting the String dateofbirth to a date see http://mindprod.com/jgloss/calendar.html -- Canadian Mind Products, Roedy Green. Coaching, problem solving, economical contract programming. See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Post Follow-up to this messageOn Thu, 08 Jul 2004 14:02:16 +0200, Stefan Waldmann <stefan.k.waldmann@vr-web.de> wrote or quoted : > >Oops, misspelt your name, sorry Roedy :-( >(Not a native speaker...) I answer to anything beginning with R. In person, people rarely get my name right. it comes out Rod, Roddy, Rudy. If you are interested in hearing how I say it, see http://mindprod.com/roedy.html -- Canadian Mind Products, Roedy Green. Coaching, problem solving, economical contract programming. See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Post Follow-up to this messageRoedy Green wrote: > On Thu, 08 Jul 2004 14:02:16 +0200, Stefan Waldmann > <stefan.k.waldmann@vr-web.de> wrote or quoted : > > > > > I answer to anything beginning with R. :) remember to make exception when R is for Rawat. > In person, people > rarely get my name right. it comes out Rod, Roddy, Rudy. > > If you are interested in hearing how I say it, see > http://mindprod.com/roedy.html > Another page roedygreen.html reads. > Roedy Green The author of this glossary and prolific > poster on Internet in the comp.lang.java.* newsgroups. To > see any of my postings just ask Dejanews change that to google. --------- Just curious. Which other languages did you learn, in which sequence? -- Rawat who keep a permanent record of nearly everything anybody says on the net. You can search for me as roedy at bix.com, roedy at oberon.ark.com or most recently as roedy at mindprod.com. I don't post my current email. address in text form to avoid spam, though you can see it by click the word email.
Post Follow-up to this messageOn Fri, 09 Jul 2004 01:07:38 +0530, V S Rawat <vsrawat@hclinfinet.com> wrote or quoted : >Just curious. Which other languages did you learn, in which >sequence? Hmm. Fortran II on the IBM 1620 when I was 15 years old a sort of child astronaut allowed in with the guys in the white coats behind the locked doors (it was indescribably exciting), assembler for the IBM 7044, Algol 60, Act-V, assembler for the LGP-30, Algol-68, PL-1, COBOL, Pascal, assemblers for many machines, MINC Basic, APL, Forth, Abundance, C, C++, Java. I played around with many more. I worked for a while at UBC on differential equations. One of the perks was a library card to the computer science library where there were hundreds of books on obscure languages. I was in heaven. Forth was the most fun. Abundance is the most productive. Eiffel was the most beautiful. Java is what I am mostly using now. Bali is what I hope to be coding in some day. -- Canadian Mind Products, Roedy Green. Coaching, problem solving, economical contract programming. See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.