Click to See Complete Forum and Search --> : Formating Dates
gollnick
Apr 13th, 2004, 07:16 AM
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
indydavid32
Apr 13th, 2004, 08:46 AM
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.
dteDate = format(DateTimePicker1.value,"yyyyMMdd")
For the time thing, I would do it like this.
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.
Fishcake
Apr 13th, 2004, 10:56 AM
if you're interested in using a 3rd party control i'd recommend
this one (http://www.eworldui.net/CustomControls/CalendarPopupDemo.aspx) it's pretty customisable, very solid and best of all it's free for use in commercial projects too.
indydavid32
Apr 13th, 2004, 11:47 AM
very solid and best of all it's free for use in commercial projects too
Free is always better! :D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.