Jump to content

[SOLVED] Simple addition problem


hasanatkazmi

Recommended Posts

I am new to PHP, previously I used to code in C++

 

I am trying to convert time from server to GMT,

 

$s=localtime();

$h=$s[2];

$m=$s[1];

$s=$s[0];

if ($h<10)$h="0".$h;

if ($m<10)$m="0".$m;

if ($s<10)$s="0".$s;

$gmtdiff=(int)date('O');

$time=(int)$time;

$timegmt=$time+$gmtdiff;

$timegmt=$timegmt.$s;

 

but $timegmt comes out to as  0000ss, help plz

Link to comment
https://forums.phpfreaks.com/topic/63876-solved-simple-addition-problem/
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.