Welcome Guest, Not a member yet? Register   Sign In
Need help in getting date time with am pm
#1

[eluser]Mistry007[/eluser]
Hi every one. I have got one problem. which is as follow
I have converted date to my local time as below
Code:
$this->date_string = "%Y/%m/%d %h:%i:%s";
  $timestamp = now();
  $timezone = 'UP45';
  $daylight_saving = TRUE;
  $time =  gmt_to_local($timestamp, $timezone, $daylight_saving);
$this->updated_date = mdate($this->date_string,$time);

And Storing this field in to database.

now at retrive time i want like this format
Code:
"11-04-2011 4:50:00 PM"
I have used this code
Code:
$timestamp = strtotime($rs->updated_date);
$date1 = "%d-%m-%Y %h:%i:%s %a";
$updat1 = date($date1,$timestamp);
but this will give me only
Code:
"11-04-2011 4:50:00 AM"
but I have stored in like it was PM.
Can any one help me out.
thanks.




Messages In This Thread
Need help in getting date time with am pm - by El Forum - 04-11-2012, 04:23 AM
Need help in getting date time with am pm - by El Forum - 04-11-2012, 05:39 AM
Need help in getting date time with am pm - by El Forum - 04-11-2012, 05:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB