Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-01-2005, 09:08 PM   #1 (permalink)
thejunior
Junior Member
 
Join Date: Jul 2005
Posts: 24
Default Date variable?

Is there a php variable which holds the current date?
thejunior is offline   Reply With Quote
Sponsored Links
Old 12-02-2005, 11:51 AM   #2 (permalink)
cristobal
Senior Member
 
Join Date: Sep 2005
Posts: 219
Default

date?
[quote] print "`date '+%Y-%m-%d'";[quote]

Try that out
cristobal is offline   Reply With Quote
Old 12-03-2005, 05:38 AM   #3 (permalink)
boohlick
Webmaster Guru
 
Join Date: Aug 2005
Posts: 401
Default

or you can try this

Quote:
<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('UTC');


// Prints something like: Monday
echo date("l");

// Prints something like: Monday 15th of August 2005 03:12:46 PM
echo date('l dS \of F Y h:i:s A');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

/* use the constants in the format parameter */
// prints something like: Mon, 15 Aug 2005 15:12:46 UTC
echo date(date::RFC822);

// prints something like: 2000-07-01T00:00:00+0000
echo date(date::ATOM, mktime(0, 0, 0, 7, 1, 2000));
?>
boohlick is offline   Reply With Quote
Old 12-03-2005, 09:52 PM   #4 (permalink)
clifford
Junior Member
 
Join Date: Jun 2005
Location: Finland
Posts: 26
Default

time() is a function holding the current unix timestamp, and date() is a function used to format that value.
clifford is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 06:58 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums