Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

my PHP date 2013-04-30 becomes 1990 in PHP is there any date

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

my PHP date 2013-04-30 becomes 1990 in PHP is there any date

Postby stephenrodrics » Tue Apr 30, 2013 5:12 am

i am running in serious problem, i am retreiving date as 2013-04-30 from Database and while sending to other PHP class as hidden variables, it reach as 1990 do i need some date function to format the date ?
stephenrodrics
New php-forum User
New php-forum User
 
Posts: 53
Joined: Thu Mar 14, 2013 6:10 am

Re: my PHP date 2013-04-30 becomes 1990 in PHP is there any

Postby stephenrodrics » Tue Apr 30, 2013 6:43 am

please find my code

for($i = 0; $i<$numRows; $i++)
{

print "\t <table width =50% border = 1 bgcolor=#6699FF>
<input type='hidden' name='date' id='hiddenField' value=$json_week[$i] >
<input type='hidden' name='empidis' id='hiddenField' value=$json_empid[$i] >
<td width = 10%> <input type ='checkbox' id = 'Approve' value = 'test' name = 'Approve' onclick='this.form.submit()'>Approve</td>

<td width = 10%> <input type ='checkbox' id = 'Reject' name = 'Reject' onclick='SendRejectFormData($i,$json_empid[$i],$json_week[$i])'>Reject </td> </td> </table>\t \n";

if I do echo $json_week[$i]; its coming perfect 2013-04-30

}




//JAVASCRIPT CODE

function SendRejectFormData(var1,var2,var3)

{

var a=prompt("Enter Text","");
document.getElementById("foo").value = a;
document.getElementById("empSub").value = var2;
document.getElementById("empweek").value = var3;

document.apprejectdone.submit();

In this function also if I say

alert(var2); i am getting 1900 as date


};

I am passing var3 as 2013-04-30

in PHP it reaches as 1900



<form name="apprejectdone" method="post" id ="appreject" action= "ApproveReject.php" >


<input type = "hidden" id = "foo" name = "foo">

<input type = "hidden" id = "empSub" name = "empSub">

<input type = "hidden" id = "empweek" name = "empweek">



IN php class



$receivedweekis = $_POST['date']; //getting = 1900 or 1970
stephenrodrics
New php-forum User
New php-forum User
 
Posts: 53
Joined: Thu Mar 14, 2013 6:10 am


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

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