RE: Date + Time
| From: | Simon Willison | Date: | Thu, 25 Jan 2001 11:36:11 +0000 |
| Subject: | RE: Date + Time | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-5204@lists.php.net to get a copy of this message | ||
You can use PHP's date function to do this - information here:
http://www.php.net/date
In your case the function would be...
$yourdate = date("d") . (date("w") + 1) . date("mY");
I'm pretty sure that will work - I had to use a messy construct because the
"w" element of the date function returns Sunday as 0 rather than 1
Read up on the PHP date function - it's very powerful and very easy to use
Cheers,
Simon
-----Original Message-----
From: Ben Cairns [mailto:BenC@intasept.com]
Sent: 25 January 2001 10:22
To: php-windows@lists.php.net
Subject: Date + Time
I need to get the date, day, month,year from the server that PHP is running
on. How can I do this.
I need this information to be returned like:
255012001
Explained:
The Date (Numerical - 2 Digits)
Day (Day Number, Weeks starts on Sunday - Sun=1, Mon=2, Tue=3....)
Month (Numerical - 2 Digits)
Year (Numerical - 4 digits)
but this information has to come from the SERVER as the site visitors will
be all over the world, and the date's will be wrong
Thanks in advance
-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: BenC@intasept.com
Web: http://www.intasept.com
"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK......"