Creating Date & Time

This is a discussion on "Creating Date & Time" within the Classic ASP section. This forum, and the thread "Creating Date & Time are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 23rd, 2006, 08:12
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Creating Date & Time

I'm trying to turn a couple of variables into dates and times. I believe I got the date part correct, but the time part is confusing me.
Code: Select all
newmonth = request.form("monthtest")
newyear = request.form("Season_Year")
newday = request.form("frmDay")

newdate = newmonth & "/" & newday & "/" & newyear
Response.Write MonthName(Month(newdate), True)
Response.Write "<br />"
Response.Write Day(newdate)
This seems to work, but I haven't tested it yet. The problem I have now is trying to get some variables from a form into a time.
What I am trying to do is make a schedule. The user puts in the date and time through drop downs and I save these to a database.
I was able to get the info into the schedule, but then I realized that I can't get them to order correctly since they are not dates and time.
So, what I need to do is grab three fields, hour, minute and AM/PM put these together and turn it into a time so that I can get the schedule correct.
I might have an idea to do it without it being a real time, but I would like it to be so if I can.
Reply With Quote

  #2 (permalink)  
Old Jan 23rd, 2006, 13:55
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Creating Date & Time

From http://www.w3schools.com/vbscript/vb..._functions.asp
use CDate
Reply With Quote
Reply

Tags
creating, date, time

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date & Time [Combine] doctypedeclaration JavaScript Forum 3 Mar 12th, 2008 01:22
Update Date/Time Button selfAfflicted JavaScript Forum 2 Aug 8th, 2007 14:25
Can't open the date time picker yuenli JavaScript Forum 0 Jul 3rd, 2007 07:22
How to format date/time from input box ? kahpeng Classic ASP 1 Mar 27th, 2006 05:08
Server time and date script gribble JavaScript Forum 1 Aug 16th, 2005 09:53


All times are GMT. The time now is 21:57.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43