SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: How to get 'timestamp'?
Hybrid View
-
Jul 18, 2000, 05:08 #1
- Join Date
- Dec 1999
- Posts
- 85
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi, I was wondering how I can get the 14 digit timestamp from PHP3? I tried to insert a row in phpMyAdmin with no luck. My guess is that I have to get this value in PHP3 program?
Please help.
-
Jul 18, 2000, 18:16 #2
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
If you want to insert the current time into a TIMESTAMP-type column in MySQL, all you have to do is insert NULL. MySQL will calculate the timestamp itself. Changing the values of any of the other columns in the row will also automatically update the first TIMESTAMP column in the row.
If this doesn't answer your question, let me know and I'll try to help further.
------------------
-Kevin Yank.
http://www.SitePoint.com/
Helping Small Business Grow Online!
-
Jul 19, 2000, 07:21 #3
- Join Date
- Dec 1999
- Posts
- 85
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi, it doesn't work. Our server does not insert a timestamp for me. I have to do it the old-fashion way using a time() thing and change it a 14-digit timestamp.
I have timestamp ready; can you tell me how to display last month's news?
Thanks!
-
Jul 19, 2000, 21:05 #4
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote
/font><HR>Hi, it doesn't work. Our server does not insert a timestamp for me. I have to do it the old-fashion way using a time() thing and change it a 14-digit timestamp.<HR></BLOCKQUOTE>
Here's how to generate the 14-digit timestamp you need in PHP:
$timestamp = date("YmdHis");
I stress again, however, that you should NOT have to do this. If MySQL isn't inserting the timestamp for you, this may be a symptom of a bigger problem!
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>I have timestamp ready; can you tell me how to display last month's news?<HR></BLOCKQUOTE>
News? What are you talking about, here?
------------------
-Kevin Yank.
http://www.SitePoint.com/
Helping Small Business Grow Online!
Bookmarks