Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie

Status
Not open for further replies.

Dukester0122

IS-IT--Management
Mar 18, 2003
587
US
I'm new to php and creating a script which would convert the current date to an integer.

<?php
$date = 'echo date(F j Y)';
settype($date, "integer");
echo $date;
?>
 
I'm not sure what your code would do, but "'echo date(F j Y)'" is a string, not something PHP might execute. So using settype() on that will always return zero.

Something like:

Code:
<?php
print strtotime('now');
?>

will probably do it.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top