Page 1 of 1

event calender date problem

Posted: Thu Jun 03, 2010 5:43 am
by adamrain
hi, im making an event calender and having a problem with a variable containing the time stamp here is the code.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$day=date('j');
$month=date('n');
$year=date('y');

echo$day."/".$month."/".$year; 

$curentTimestamp=strtotime("$day-$month-$year");
$monthname=date("f",$curentTimestamp);
$numdays=date("t",$curentTimestamp);
$counter=0;

?>
<table width="200" border="1">
  <tr>
    <td>&nbsp;</td>
    <td colspan="5"><?php echo $monthname;?></td>
   
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width='50'>sun</td>
    <td width='50'>mon</td>
    <td width='50'>tue</td>
    <td width='50'>wed</td>
    <td width='50'>thu</td>
    <td width='50'>fri</td>
    <td width='50'>sat</td>
  </tr>
</table>
</body>
</html>
here is the line whith the problem

Code: Select all

$curentTimestamp=strtotime("$day-$month-$year");
im not so good with dates even without php and im not so good with the date func,but i know ill need the time stemp for things like month or year,later.

Re: event calender date problem

Posted: Thu Jun 03, 2010 6:00 am
by markusn00b
What exactly is your problem?

Re: event calender date problem

Posted: Thu Jun 03, 2010 7:06 am
by adamrain
it dosnt show the month when i use the time stemp it showes "f"

Re: event calender date problem

Posted: Thu Jun 03, 2010 9:24 am
by AbraCadaver
adamrain wrote:it dosnt show the month when i use the time stemp it showes "f"
Are you sure there is a format "f"? How about "F"?

Re: event calender date problem

Posted: Thu Jun 03, 2010 9:52 am
by adamrain
I feel so stupid it worked! there is no f format my bad....such a simple error and i couldnt handle it thank you man, thank you forum.