|
|
|
ขอสอบถาม code php บวก วันเดือนปี ครับ เช่น 2015-10-01 + 4 ปี = 2019-10-01 |
|
|
|
|
|
|
|
Code (PHP)
$olddate='2015-10-01';
$result_date = strtotime('+4 year', strtotime($olddate));
|
|
|
|
|
Date :
2015-11-27 15:27:46 |
By :
NewbiePHP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHP DateAdd
|
|
|
|
|
Date :
2015-11-27 15:28:41 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['SN']; ?></td>
<td><?php echo $row_Recordset1['name']; ?></td>
<td><?php echo $row_Recordset1['model']; ?></td>
<td><?php echo $row_Recordset1['forwork']; ?></td>
<td align="center"><?php echo $row_Recordset1['waranty']; ?></td>
<td><?php echo $row_Recordset1['IV']; ?></td>
<td><?php echo $row_Recordset1['vendor']; ?></td>
<td><?php echo $row_Recordset1['date']; ?></td>
<td></td>
</tr>
|
|
|
|
|
Date :
2015-11-27 16:04:29 |
By :
auyjunk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<td><?php echo strtotime("+".$row_Recordset1['waranty']." year", strtotime($row_Recordset1['date']));?></td>
|
|
|
|
|
Date :
2015-11-27 16:10:49 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผลลัพ ได้แบบนี้ครับ
|
|
|
|
|
Date :
2015-11-27 16:18:58 |
By :
auyjunk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['SN']; ?></td>
<td><?php echo $row_Recordset1['name']; ?></td>
<td><?php echo $row_Recordset1['model']; ?></td>
<td><?php echo $row_Recordset1['forwork']; ?></td>
<td align="center"><?php echo $row_Recordset1['waranty']; ?></td>
<td><?php echo $row_Recordset1['IV']; ?></td>
<td><?php echo $row_Recordset1['vendor']; ?></td>
<td><?php echo $row_Recordset1['date']; ?></td>
<td><?PHP echo date('Y-m-d', strtotime($row_Recordset1['date']."+".$row_Recordset1['waranty']." year")); ?></td>
</tr>
|
|
|
|
|
Date :
2015-11-27 16:30:41 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<td><?php echo date("Y-m-d", strtotime("+".$row_Recordset1['waranty']." day", strtotime($row_Recordset1['date'])));?></td>
ว่าง ๆ อ่าน Link ที่ผมแปะให้ก็ดีนะครับ มีตัวอย่างครบ
|
|
|
|
|
Date :
2015-11-27 16:30:48 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณพี่ๆมากเลยนะครับ ใว้มีอะรัยสงสัยจะมาถามอีกนะครับ
|
|
|
|
|
Date :
2015-11-27 16:42:13 |
By :
auyjunk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|