i have the function i made:
function CreateDate($day, $month, $year) {
if(!empty($day) !empty($month) !empty($year)){
//convert $day, $month, and $year into a valid timestamp
$time= strtotime($day, mktime(0,0,0,$month,1,$year));
$time=date(YmdHis, $time);
return $time; }
else {
return false; }}
From: Andy B [EMAIL PROTECTED]
i have the function i made:
function CreateDate($day, $month, $year) {
if(!empty($day) !empty($month) !empty($year)){
//convert $day, $month, and $year into a valid timestamp
$time= strtotime($day, mktime(0,0,0,$month,1,$year));
$time=date(YmdHis, $time);
Hello Andy,
Tuesday, April 6, 2004, 2:18:45 PM, you wrote:
AB i have the function i made:
AB function CreateDate($day, $month, $year) {
AB if(!empty($day) !empty($month) !empty($year)){
AB //convert $day, $month, and $year into a valid timestamp
AB $time= strtotime($day,
by the way
change ur if alittle.. change the to ||
John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
From: Andy B [EMAIL PROTECTED]
i have the function i made:
function CreateDate($day, $month, $year) {
if(!empty($day) !empty($month) !empty($year)){
//convert
I've seen this type of creating a timestamp quite often now and was even so
often shaking my head about it. Guess i've seen it somewhere in the PHP
Documentation's user contributed notes on day. Just google for the term and
you will find many hits like this:
http://www.mail-archive.com/[EMAIL
Hello Red,
Tuesday, April 6, 2004, 3:40:07 PM, you wrote:
RW I've seen this type of creating a timestamp quite often now and was even so
RW often shaking my head about it. Guess i've seen it somewhere in the PHP
RW Documentation's user contributed notes on day. Just google for the term and
RW
Replace the above two lines with
$time = date('YmdHis', mktime(0,0,0,$month,$day,$year);
ok the function works now because when i echo the output of
$_SESSION['add']['start_date'] it shows the right 14 digit timestamp for the
date i wanted to create... now the problem is getting it to echo
From: Andy B [EMAIL PROTECTED]
Replace the above two lines with
$time = date('YmdHis', mktime(0,0,0,$month,$day,$year);
ok the function works now because when i echo the output of
$_SESSION['add']['start_date'] it shows the right 14 digit timestamp for
the
date i wanted to create...
date() expects a UNIX timestamp. MMDDHHMMSS is NOT a UNIX timestamp.
So,
instead of converting the UNIX timestamp to MMDDHHMMSS in your function,
why not leave it a UNIX timestamp? Then you can send it through date()
whenever you want it formatted.
yea...it works now...hmmm... dont know
9 matches
Mail list logo