473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Time Stamp

I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that will
show the time it was entered into the database. I think all I need is the
syntax for writing the server time to the TimeStamp field in the record. I
have hidden field in the form that I alocated. So how do I get it to write
the current time to the database. Here is the current code:
<form name="form1" method="POST" action="<%=MM_editAction%>">
<table width="500" cellpadding="2" cellspacing="0">
<tr>
<td width="242" class="tdtl">Are you coming to the lake this weekend?
</td>
<td width="244" class="tdtr"><input name="Answer" type="radio"
value="Yes" checked>
Yes&nbsp;&nbsp;&nbsp; <input name="Answer" type="radio"
value="No">
No</td>
</tr>
<tr>
<td class="tdleft">Your Name Please </td>
<td class="tdright"><input name="Name" type="text" id="Name"
size="40"></td>
</tr>
<tr>
<td class="tdleft">I will be arriving on . . . </td>
<td class="tdright"><select name="Arriving" size="1" id="Arriving">
<option value="Cant make it">Cant make it</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
</select></td>
</tr>
<tr>
<td class="tdleft">Boathouse</td>
<td class="tdright"><input name="BoatHouse" type="text" id="BoatHouse"
size="6" maxlength="6">&nbsp;&nbsp; </td>
</tr>
<tr align="center">
<td colspan="2" class="tdleft"><input name="Submit" type="submit"
onClick="MM_validateForm('Name','','R');return document.MM_returnValue"
value="Submit"></td>
</tr>
</table>

<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this to work
right?

Thanks

Houston


Nov 13 '05 #1
2 1916
"Houston" <ho*****@hbip.com> wrote in message
news:0o*****************@newssvr23.news.prodigy.co m
I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that
will show the time it was entered into the database. I think all I
need is the syntax for writing the server time to the TimeStamp field
in the record. I have hidden field in the form that I alocated. So
how do I get it to write the current time to the database. Here is
the current code:
<snip>
<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this
to work right?

Thanks

Houston


You could, but that would get the local time???

If you are setting the timestamp shouldn't you just have some script in
the code that processes the form and adds the record? eg. <%
rsList("Timestamp") = Now() %>

(Note: rsList(Timestamp") is just shorthand as .Field.Item is the
default property)

Are you using Access as the back end database? You could set the
"default value" of that field in the table to = Now() (returns date &
time). If using MSSQL you could use a stored procedure to add the record
and that would set the timestamp.
--
regards,

Bradley
Nov 13 '05 #2
I appreciate your help, I ended up just putting in a Hidden field and had it
write the current time into the "TimeLog" column of an access database using
"Value = <% NOW() %>" Works great

Thanks again.

"Bradley" <sp*****@blockmail.com> wrote in message
news:41********@news.melbourne.pipenetworks.com...
"Houston" <ho*****@hbip.com> wrote in message
news:0o*****************@newssvr23.news.prodigy.co m
I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that
will show the time it was entered into the database. I think all I
need is the syntax for writing the server time to the TimeStamp field
in the record. I have hidden field in the form that I alocated. So
how do I get it to write the current time to the database. Here is
the current code:


<snip>
<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this
to work right?

Thanks

Houston


You could, but that would get the local time???

If you are setting the timestamp shouldn't you just have some script in
the code that processes the form and adds the record? eg. <%
rsList("Timestamp") = Now() %>

(Note: rsList(Timestamp") is just shorthand as .Field.Item is the
default property)

Are you using Access as the back end database? You could set the
"default value" of that field in the table to = Now() (returns date &
time). If using MSSQL you could use a stored procedure to add the record
and that would set the timestamp.
--
regards,

Bradley

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Yang Li Ke | last post by:
Hi guys, Im about to build a script which will log visitor time spent on my website. I got a few ideas about this, maybe checking visitors ip and storing that info in db with time in and then...
7
by: Don | last post by:
Hi all, With regards to the following, how do I append the datetimestamp to the filenames in the form? The files are processed using the PHP script that follows below. Thanks in advance,...
3
by: phried1 | last post by:
I have created a form and inserted the following tables: Date Entered Time Entered Date Modified Time Modified Essentially how and where can I have these dates and times recorded so when the...
4
by: SilentThunderer | last post by:
Hey folks, Let me start out by letting you know what I'm working with. I'm building an application in VB 2005 that is basically a userform that employees can use to "Clock in". The form...
2
by: Shane | last post by:
I'm writing a program for renaming my picture files, and I want to use the picture time stamp as a prefix to the file names. I can get the time stamp, but it is extraordinarily slow! I have about...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.