jQuery in Action, 2nd edition
The moose likes JSP and the fly likes Validate date and time in locat time. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Validate date and time in locat time." Watch "Validate date and time in locat time." New topic
Author

Validate date and time in locat time.

dsw dsw
Greenhorn

Joined: Jan 31, 2003
Posts: 6
Hi,
I have a field which displays the date in the local time . I want to write a function to validate if the date and time is correct .How do i accomplish this. This should take care of all languages not only english.
I am using the toLocaleString() function to convert the date to the local time .
I would really appreciate your Input on this.
Thanks
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 259
what do you mean "in local time"?
you want to display client's local time or
the time on your server?


Asher Tarnopolski
SCJP,SCWCD
dsw dsw
Greenhorn

Joined: Jan 31, 2003
Posts: 6
Let me explain the problem more clearly.
I have a field where the user enters the field in mm/dd/yyyy format. I use the tolocaleString to convert the date/time in the regional format.
For example if i enter the date as 1/12/2003.
Then it automatically converts the date as
Sunday, January 12, 2003 12:00:00 AM if my settings are in English. It gets converted to equivalent date and time if the setting is french and so on.
I want to write a function which validates this date and time Sunday, January 12, 2003 12:00:00 AM
is valid or not.
Let me know if you need additional clarification.
Thanks
 
 
subject: Validate date and time in locat time.
 
Threads others viewed
how to extract the date n time from images
painful java.util.Date bug
Java vs. Javascript
Greenwich mean time
2 dates per post?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com