Forums

ASP

This topic is locked

Date & Time

Posted 16 Apr 2002 21:13:07
1
has voted
16 Apr 2002 21:13:07 Tony Chronopoulos posted:
Hello everyone!

I'm making a mini message board from scratch and I just have one little question.

I was able to add a new post and it would save the topic and message. When I click "Add", I want it to now save the current date and time. I already have 2 fields in my table for date & time.

PLEASE HELP ME! <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

Replies

Replied 17 Apr 2002 05:22:58
17 Apr 2002 05:22:58 Hank Tan-Tenn replied:
Assuming you use VBScript, the function Now() gives both the date and time. YOu really only need 1 field. Alternatives, Date(), Time(). See any VBS reference for details.



Replied 17 Apr 2002 10:47:15
17 Apr 2002 10:47:15 Andrew Watson replied:
DO this in the database ,..

if youre using access set the default value of the DateStamp field to Date() and the default value of the TimeStamp Field to Time().

But as akc says you only need one field with its default value set to Now().
Replied 17 Apr 2002 15:29:22
17 Apr 2002 15:29:22 Tony Chronopoulos replied:
So that means I don't have to add any code into my ASP page? I just add the "Now()" straight into my Date/Time field in my Access DB?

Where exactly do I put "Now()"? <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle> (I don't know too much! hehehe)

Thanks a lot,

Tony

Replied 17 Apr 2002 15:33:42
17 Apr 2002 15:33:42 Tony Chronopoulos replied:
Ok, nevermind! hehe.. I finally got it.

Thanks a lot guys..

Tony

Replied 21 Nov 2002 17:12:49
21 Nov 2002 17:12:49 Ken Dobson replied:
AAAAAAAARGH! Sorry. Stress reliever.

I've used the Date() and Time() feature to store this info into an Access database many times before. What I've come to realize is that it works fine on NEW records. A few days ago, I wanted to save the exact time a record was updated. I have a field in my access database and it's set to medium time and the default value is Time(). On my form, I have a hidden field and I've tried many different options for the default value and they all won't save to the record I'm saving. Can anyone shed any light on this for me please?

On my form, I've tried &lt;%Time()%&gt;, &lt;%Date()%&gt; and &lt;%Now()%&gt; and none of them have worked. The Update part shows that this field is being saved as Date MS Access.

Any help is greatly appreciated. Thanks!!

Reply to this topic