ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 25th, 2008, 10:18 AM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
VBScript - General - Question - Adding a time field to an asp page that saves to mysql

This is an asp page that adds news articles to an mysql database.

The form adds the time to the database. On the public side it shows

11/22/2008 12:00:00 AM

which means a time isn't being entered in the database. the database is set to DATETIME with no default. DB 3 is MySQL



The page that adds the the article and sends it to the database is this and this is the relevant part of the code i think,

news_add.asp



Code:
<%Dim MODE, MESSAGE, CATE_STR, SQL, RS, CATE, AGENT, ACTIVE, ALLOW_C, ALLOW_V, TITLE, SUMMARY, IMAGE, CONTENT, I, _
          arrCATE, ID, sDATE, eDATE, TID, TEMPLATE, A_C, A_V, APPROVE, HLITE, AGENT_STR, USE_VIEW
    
    MODE = Request.Form("mode")
    TID  = Trim(Request.QueryString("TID"))

    
    Call CREATE_SECURITY()    
    IF NOT Trim(arrLEVEL(27)) = "1" THEN MESSAGE = "<li />Sorry, you don't have access to this section."    
    
    '
    '<description> add new article to the DB </description>
    '
    IF MODE = "add" THEN
        
        With Request
            arrCATE     = Split(APO(.Form("cate")),",")
            AGENT    = APO(.Form("agent"))
            ACTIVE   = CONVERT_NUM(.Form("active"))
            ALLOW_C  = CONVERT_NUM(.Form("allow_c"))
            ALLOW_V  = CONVERT_NUM(.Form("allow_v"))
            TITLE    = APO(.Form("title"))
            SUMMARY  = APO(STRIP_CODE(.Form("summary")))
			USE_VIEW = APO(.Form("USE_VIEW"))
            IMAGE    = APO(.Form("image"))            
            CONTENT  = APO_LAX(.Form("content"))            
			IF DB_TO_USE = 3 THEN
				sDATE = .Form("sY") & "-" & .Form("sM") & "-" & .Form("sD")	
				eDATE = .Form("eY") & "-" & .Form("eM") & "-" & .Form("eD")	
			ELSE
				sDATE    = ASEMBLE_DATE_FORMAT(.Form("sD"),.Form("sM"),.Form("sY"))
	            eDATE    = ASEMBLE_DATE_FORMAT(.Form("eD"),.Form("eM"),.Form("eY"))  
			END IF  
            HLITE    = CONVERT_NUM(.Form("hlite"))
        End With
    
        Call CHECK_INQP()        
        
        IF MESSAGE = "" THEN        	
            '
            '<description> add article </description>
            '               
        
                SQL = "INSERT INTO nm_tbl_news (fldTITLE, fldCONTENT, fldSUMMARY, fldACTIVE, fldAID, fldPOSTED, fldEXPIRES, fldIMAGE, fldALLOW_COMMENTS, fldALLOW_VOTING, fldHIGHLIGHT, fldUSE_VIEW) VALUES ('" & TITLE & "','" & CONTENT & "','" & SUMMARY & "'," & ACTIVE & "," & AGENT & ",'" & sDATE & "','" & eDATE & "','" & IMAGE & "'," & ALLOW_C & "," & ALLOW_V & "," & HLITE & ", " & USE_VIEW & ")"
           
		    END IF


I think it is to this part, where i need to add something so that there is a datefield which also adds the time to the database.

Code:
IF DB_TO_USE = 3 THEN
	  sDATE = .Form("sY") & "-" & .Form("sM") & "-" & .Form("sD")	
	  eDATE = .Form("eY") & "-" & .Form("eM") & "-" & .Form("eD")


can someone pls show me what to add where, and if any other code in the page would need changing too? Many thanks

Reply With Quote
  #2  
Old November 26th, 2008, 05:42 AM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
In addition to the code above, I think i should show the actual form fields in the page that add the date.
I think it is here that i need to enter a TIME VALUE, so that in addition to the date, there would be a time field

This is the part of the form that has the publish and expiry date fields, that adds the date, so i assume something needs to be added here that will pluck the time too?


Just to clarify, these 2 dates below can be changed ie. an article can be set to be published at a future date, and the expiry date can be changed too. There is one other date field that is automatically added to the database which is called fldCREATED, and that is set to default at CURRENT_TIMESTAMP, the date, it was added to the database.

But the code below is for the publish and expiry dates, i need to add a time field

publish date code

Code:
<table cellpadding="2" cellspacing="0" border="0" width="100%"><tr>
								<td>
									<table cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Publish Date:</td>
										<td><select name="sM" id="sM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sD" id="sD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sY" id="sY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>





expiry date code

Code:
<table align="right" cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Expires Date:</td>
										<td><select name="eM" id="eM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td id="eD"><select name="eD" id="eD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(Day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="eY" id="eY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date+365)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>



Could anyone show me how to add a time field here so that the time also gets saved to to the database?

Reply With Quote
  #3  
Old November 26th, 2008, 05:55 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,925 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 6 m 39 sec
Reputation Power: 1995
you never give any time so it's obvious that you'll see no time.
this code:
Code:
sDATE = .Form("sY") & "-" & .Form("sM") & "-" & .Form("sD")

means the value that is entered to the database is the string "2008-11-22"
and the database know to interpret it as November 22nd, 2008 and give
default of 12:00 AM time.

you need to add time fields (hour and minute) name them "sHour" and "sMinute"
accordingly then have such code:
Code:
eDATE = .Form("eY") & "-" & .Form("eM") & "-" & .Form("eD") & " " & .Form("eHour") & ":" & .Form("eMinute")

Reply With Quote
  #4  
Old November 26th, 2008, 06:12 AM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
you never give any time so it's obvious that you'll see no time.
this code:
Code:
sDATE = .Form("sY") & "-" & .Form("sM") & "-" & .Form("sD")

means the value that is entered to the database is the string "2008-11-22"
and the database know to interpret it as November 22nd, 2008 and give
default of 12:00 AM time.

you need to add time fields (hour and minute) name them "sHour" and "sMinute"
accordingly then have such code:
Code:
eDATE = .Form("eY") & "-" & .Form("eM") & "-" & .Form("eD") & " " & .Form("eHour") & ":" & .Form("eMinute")


Thank you Shadow Wizard,

Is that the only part of the code i need to change so that the time gets entered in all the fields?

I will try that,

In the meantime, i will say that the fldCREATED is the only one of the 3 time fields that shows the time in the database.

fldCREATED doesn't need the code above for the date to show it's record in the database . Is that because it is set to TIMESTAMP in the database with a default of CURRENT_TIMESTAMP?

in the database this is what fldCREATED shows

2008-11-22 18:31:54

but fldPOSTED shows

2008-11-22 00:00:00

and fldEXPIRY shows
2030-11-22 00:00:00

Reply With Quote
  #5  
Old November 26th, 2008, 07:06 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,925 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 6 m 39 sec
Reputation Power: 1995
the above code will "fix" the fied "fldEXPIRY", you'll have to do
the same for eDATE in order to fix fldPOSTED as well.

the time inside fldCREATED is the time when the new record was added.
it's there because of the the default value you have.

Reply With Quote
  #6  
Old November 26th, 2008, 03:08 PM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
the above code will "fix" the fied "fldEXPIRY", you'll have to do
the same for eDATE in order to fix fldPOSTED as well.

the time inside fldCREATED is the time when the new record was added.
it's there because of the the default value you have.


ShadowWizard, i tried this code as you suggested (added minutes and hours)
Code:

IF DB_TO_USE = 3 THEN
	IF DB_TO_USE = 3 THEN
				sDATE = .Form("sY") & "-" & .Form("sM") & "-" & .Form("sD") & " " & .Form("sHour") & ":" & .Form("sMinute")	
				eDATE = .Form("eY") & "-" & .Form("eM") & "-" & .Form("eD") & " " & .Form("eHour") & ":" & .Form("eMinute")	


but when i try to add an article the date isn't recognised, it shows this error


Please select valid publish date.
Please select valid expiry date.


Surely i need to add something to the form fields in the page? Thats why i posted them too, in the second post in this thread.

The code you gave me altered what is actually going in the database, it's not doing anything to the form fields that are inputting the data. There are two fields, the publish date and expiry dates. I think i need to do something to these too.

Reply With Quote
  #7  
Old November 27th, 2008, 11:04 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,925 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 6 m 39 sec
Reputation Power: 1995
I have no idea what's going on, post relevant code and I'll try to help
you solve this problem.

Reply With Quote
  #8  
Old November 27th, 2008, 11:44 AM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
I have no idea what's going on, post relevant code and I'll try to help
you solve this problem.



This is the part of the form that has the publish and expiry date fields, that adds the date, so i assume something needs to be added here that will pluck the time too?




the code below is for the publish and expiry dates, i need to add a time field to each i think

publish date code

Code:
<table cellpadding="2" cellspacing="0" border="0" width="100%"><tr>
								<td>
									<table cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Publish Date:</td>
										<td><select name="sM" id="sM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sD" id="sD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sY" id="sY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>





expiry date code

Code:
<table align="right" cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Expires Date:</td>
										<td><select name="eM" id="eM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td id="eD"><select name="eD" id="eD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(Day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="eY" id="eY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date+365)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>

Reply With Quote
  #9  
Old November 27th, 2008, 12:34 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,925 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391021 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 6 m 39 sec
Reputation Power: 1995
indeed. add those lines for publish date:
Code:
										<td><select name="sHour" id="sHour"><%FOR I = 0 TO 23%><option<%If Trim(I) = Trim(Hour(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>:</td>
										<td><select name="sMinute" id="sMinute"><%FOR I = 0 TO 59%><option<%If Trim(I) = Trim(Minute(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>

and same way add lines to expiry date.
(changing the name and ID of the select)

Reply With Quote
  #10  
Old November 28th, 2008, 08:13 PM
janeytopps janeytopps is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level)janeytopps User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 41 sec
Reputation Power: 0
Shadow Wizard, thanks, that seems to work fine

The date on the public side shows

11/29/2008 12:49:00 AM

I was wondering , could i add seconds too, instead of always 00 at the end? it would help in the sitemaps.

One other thing,

on the page that adds the article, the fields i showed you above, for the day, month and year, are automatically pointing to the current time. ( i can of course change them, and usually i only change the expiry date, to set it for a longer date than the one year it selects)

I note that the new fields i added, are set to zero. ie. the hour and minutes. I added the hour and minutes manually. But i'd like it to be set to the server or other auto time. This saves a lot of time. The only thing i usually alter on these defaults is either the publishing date and always the expiry date. The hour, minute and seconds can be set automatically, and i don't think i'll be changing them usually.

How can i set these so that they show the hour and minute of the server? and also the other field i want, ie. the seconds field, should also be part of the default.

Here is the code on the page i'm now using,


Code:
<<table cellpadding="2" cellspacing="0" border="0" width="100%"><tr>
								<td>
									<table cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Publish Date:</td>
										<td><select name="sM" id="sM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sD" id="sD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="sY" id="sY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										
										<td><select name="sHour" id="sHour"><%FOR I = 0 TO 23%><option<%If Trim(I) = Trim(Hour(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>:</td>
										<td><select name="sMinute" id="sMinute"><%FOR I = 0 TO 59%><option<%If Trim(I) = Trim(Minute(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>										
									
										td><A HREF="#" onClick="cal15.showCalendar('anchor15',getDateString(docume  nt.forms[0].sY,document.forms[0].sM,document.forms[0].sD)); return false;" TITLE="cal15.showCalendar('anchor15',getDateString(docume  nt.forms[0].sY,document.forms[0].sM,document.forms[0].sD)); return false;" NAME="anchor15" ID="anchor15"><img src="images/calendar_pick.gif" width="16" height="16" alt="Select date ..." border="0" /></A></td>
									</tr></table>		
								</td>
								<td>
									<table align="right" cellpadding="2" cellspacing="0" border="0"><tr>
										<td>Expires Date:</td>
										<td><select name="eM" id="eM"><%FOR I = 1 TO 12%><option<%If Trim(I) = Trim(Month(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td id="eD"><select name="eD" id="eD"><%FOR I = 1 TO 31%><option<%If Trim(I) = Trim(Day(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>/</td>
										<td><select name="eY" id="eY"><%FOR I = 2001 TO 2030%><option<%If Trim(I) = Trim(Year(Date+365)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										
										<td><select name="eHour" id="eHour"><%FOR I = 0 TO 23%><option<%If Trim(I) = Trim(Hour(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										<td>:</td>
										<td><select name="eMinute" id="eMinute"><%FOR I = 0 TO 59%><option<%If Trim(I) = Trim(Minute(Date)) Then %> selected<%End If%> value="<%=I%>"><%=I%><%NEXT%></select></td>
										
										
										
										
										<td><A HREF="#" onClick="cal20.showCalendar('anchor20',getDateString(docume  nt.forms[0].eY,document.forms[0].eM,document.forms[0].eD)); return false;" TITLE="cal20.showCalendar('anchor20',getDateString(docume  nt.forms[0].eY,document.forms[0].eM,document.forms[0].eD)); return false;" NAME="anchor20" ID="anchor20"><img src="images/calendar_pick.gif" width="16" height="16" alt="Select date ..." border="0" /></A></td>
									</tr></table>		
								</td>
							</tr></table>
						
						</td>					
					</tr>					
					<tr><td colspan="2"><br /><br /></td></tr>					
                	<tr>
                		<td>Article Title:</td>
                		<td align="right"><input type="Text" name="title" value="" maxlength="85" size="60" style="width: 450px;" class="textbox" /></td>
                	</tr><tr>
                		<td valign="top">Article&nbsp;Summary:</td>
                		<td align="right"><textarea rows="2" cols="64" name="summary" class="textbox" style="width:450px;"></textarea></td>
                	</tr><tr>
                		<td>Article Image URL:</td>
                		<td align="right"><input type="Text" name="image" value="" maxlength="255" size="60" style="width: 408px;" class="textbox" />&nbsp;<a href="f_manager.asp?gateway=ArticleImage" onClick="NewWindow(this.href,'name','515','320','No');retur  n false;"><img src="images/src.gif" width="16" height="16" alt="Select Image ..." border="0" /></a>&nbsp;<a href="#" onClick="return ValidateImageNews(frm.image.value);"><img src="images/ico_open_url.gif" width="18" height="15" alt="Preview URL" border="0"></a>




and here is some other code on the page . I did't include the javascript calender call code, which is in a separate file,

Code:
 '<description> Check the input content </description>
    '    
    SUB CHECK_INP()
        IF Ubound(arrCATE) = -1 THEN MESSAGE = MESSAGE & "<li />Please select at least one category for the article."
        IF TITLE = "" OR IsNUll(TITLE) THEN MESSAGE = MESSAGE & "<li />Please enter article title."
        IF SUMMARY = "" OR IsNUll(SUMMARY) THEN MESSAGE = MESSAGE & "<li />Please enter article summary."
        IF CONTENT = "" OR IsNUll(CONTENT) THEN MESSAGE = MESSAGE & "<li />Please enter article content."
        IF IsDate(sDATE) = False THEN MESSAGE = MESSAGE & "<