I was juts wondering exactly what this is... :)
Thanks,
~someonewhois
Printable View
I was juts wondering exactly what this is... :)
Thanks,
~someonewhois
It gives the number of seconds since the epoch. I'm not fully clued up on this, but it is some date in the past that UNIX dates are based on, or something like that :p
[edit]Here is some more info:
http://www.linuxplanet.com/linuxplanet/tutorials/215/1/
Sean :)
/me thinks that was copied from the php manual! :p
I see...
I got this code from a friend for flood control, and it uses that date. If you take it from like 5 minutes ago, in a database, and you subtract if with the now ("U"), it'll give you 1 for soem reason.
I will chagne it to something mroe specific..
Thanks,
~someonewhois
a trick you could use is assign a variable at the top of the page...
Then you could just use the variables....just a time saving idea. ;)PHP Code:$nowtime = now("U");
$phpdate = date("U");
Sketch
Errm...
I tried that...
:rolleyes:Quote:
Fatal error: Call to undefined function: now()
Quote:
Originally posted by Sketch
SketchPHP Code:$nowtime = now("U");
$phpdate = date("U");
/me thinks Sketch mistook MySQL for PHP <smile>
now() is a MySQL date-tag, and has nothing to do with PHP, per-sae.
is simply a method of acquiring the date/time stamp in UNIX format.PHP Code:date('U');
There are still a fair amount of programers who still use the UNIX-Format, for dates within their scripts.
Others use GMT, and others use the SQL method of xxxx-xx-xx xx:xx:xx
Which one you use, AFAI'm concerned, is which one you like the best. Many, many, people will tell you 'xyz' is the best, but I've never seen anything to really prove one method is better than the other.
The only problem I've ever encountered using Unix-format, is that it doesn't handle dates 50+ years ago. So, if you are have a field where people enter their age, and you have a bunch of old'folk, the datestamp will not work correctly. I cannot comment on GMT method, never used it. The normal SQL method is really good if you are a SQL fan.
Anyway, these are just my own thoughts and opinions.
I see, thank you! :)
I kinda figured somethign liek that! ;)
Thanks,
~someonewhois
BTW, date('U') is exactly the same as time(), no? :)
www.php.net/date has a list of all the letters used for time.
is this in reply to me? i'm aware of all the letters used in date(). :) i'm saying that date('U') is, according to the page you linkedQuote:
this is exactly the same as time()'s output, is it not? ;) run thisQuote:
U - seconds since the epoch
and they should both be the same, proving my point. :)PHP Code:echo date('U'), '<br />', time();