LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2006, 08:05 PM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
java date and time manipulation?


hello all im trying to write a quick function to check if a date exists, if so place it into a string i.e.

i have three text boxes txtDay, txtMonth, txtYear;

i was trying something like this:

GregorianCalendar gc1 = new GregorianCalendar( year, month, day );

in theory if i was to enter a string into one of the text boxes it should throw a paddy because its not a date. however its not.

basically i want a function to return true if i enter something like 10/07/1984 (uk date format) and false if i enter 10/99/1984

cheers, trscookie.
 
Old 07-13-2006, 06:51 PM   #2
boredandblogging
Member
 
Registered: Jun 2006
Posts: 62

Rep: Reputation: 15
maybe use SimpleDateFormat to figure out if its valid or not.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM
Java 1.4.2 question: time manipulation borgy_t Programming 2 05-06-2005 02:04 AM
date manipulation in shell peal_ss Programming 4 03-29-2004 04:43 AM
date command manipulation issue tjtoed Red Hat 1 02-04-2004 10:10 AM
perl and date manipulation Syncrm Programming 5 10-28-2002 02:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration