hi,
now i am stuggling with date format problem. i want to display a week from the selected date from the database.
for example
if i retrive the date like 6-7-2006 from the database, it should be show like 01-07-2006 to 07-07-2006 from database
thank U
i want to diaplay which week this is from a selected date
Moderator: General Moderators
e.g. there is WEEK(date[,mode]) and WEEKDAY(date) for mysql, http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
and strtotime for php, http://de2.php.net/strtotime
and date, http://de2.php.net/date
really depends on what you have and what you want to use.
and strtotime for php, http://de2.php.net/strtotime
and date, http://de2.php.net/date
really depends on what you have and what you want to use.
From saturday to friday? That's a strange week. Anyway...
It's an easy task with strtotime in php.
It's an easy task with strtotime in php.
Code: Select all
<?php
$tsEnd = strtotime('2006-07-06 friday');
$tsStart = strtotime('last saturday', $tsEnd);
echo date('d.m.Y', $tsEnd), " \n", date('d.m.Y', $tsStart);
?>