Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

problem with mktime

Codes here !

Moderators: macek, egami, gesf

problem with mktime

Postby faiyth » Mon Mar 17, 2003 4:30 pm

A SQL statement provides a date (example: 2003-03-23) but for some reason my mktime is returning that 2003-03-23 is a Fri.. it should be a Sun. What am I doing wrong?

$my_getyear = substr($f_machinescheddate, 0, 4);
$my_getday = substr($f_machinescheddate, 8);
$my_getmonth = substr($f_machinescheddate, 5, 2);
$my_getdayofweek= date("D", mktime(0,0,0,$my_getmonth,$my_getdate,$my_getyear));

More info:
my_getyear is returning 2003
my_getday is returning 23
my_getmonth is returning 03
but my_getdayofweek is returning Fri

~ Thanks
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Feb 27, 2003 1:17 pm

Postby Redcircle » Mon Mar 17, 2003 4:42 pm

$my_getdayofweek= date("D", mktime(0,0,0,$my_getmonth,$my_getdate,$my_getyear));

$my_getdate should be $my_getday
User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.