|
-
Apr 13th, 2004, 07:16 AM
#1
Thread Starter
Hyperactive Member
Formating Dates
Help .. I have a webform where the user inputs a date (04152004) and another field for time (0815).. I want to :
1: Validate this entry..... IsDate(date) was not valid on my compile
2: edit date output as 04/15/2004 and time as 8:15
3: convert this date to store as 20040415
gollnick
-
Apr 13th, 2004, 08:46 AM
#2
Fanatic Member
If you are using VS .Net I suggest you use one of the Validator controls that comes with .Net.
Of course, the date validator probably won't let them put a date in the way you have them doing it now.
What I did was purchased a DateTime control package. It was only $50. Quite a nice little control.
And, after they select the date, you can format it like this.
VB Code:
dteDate = format(DateTimePicker1.value,"yyyyMMdd")
For the time thing, I would do it like this.
VB Code:
dim dteTime as time
dteTime = left(strTime,2) & ":" & right(strtime,2)
If you want the link for the datetime control I purchased, let me know.
-
Apr 13th, 2004, 10:56 AM
#3
if you're interested in using a 3rd party control i'd recommend
this one it's pretty customisable, very solid and best of all it's free for use in commercial projects too.
-
Apr 13th, 2004, 11:47 AM
#4
Fanatic Member
very solid and best of all it's free for use in commercial projects too
Free is always better!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|