Jump to content

Convert numbers into Date


web_master

Recommended Posts

Hi,

 

I got in dBase table columns:

 

year, mont, day

 

Year is INT(4)

Month is INT(2)

Day is INT(2)

 

 

<?php 
$query_return = mysql_query("SELECT * FROM `r_monday` ORDER BY `r_monday_id` DESC");

// Check query
if(!$query_return){
	print mysql_error();
	exit;
}

// Request query
while($request = mysql_fetch_array($query_return)) {
$Date = $request['r_monday_year'].". ".$request['r_monday_month']." ".$request['r_monday_day']."."

if(date("Ymd") > $Date) {

  $DatePrint = "";

}elseif(date("Ymd") < $Date) {
  $DatePrint = "$Date";
}
?>

 

I think I must to convert r_monday_year, r_monday_month, r_monday_day into date format to work this script, but i dont know how can I do this?

 

Thanx for help in advanced

 

T

Link to comment
https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.