PHP turli vaqt mintaqasiga qanday aylantiriladi?

Menda vaqt markalari mavjud: 1319673600 va 1319785200 .

ularni GMT-7 ga qanday qilib o'zgartiraman?

1319673600 uchun, vaqt:

GMT: Thu, 27 Oct 2011 00:00:00 GMT
GMT-7: Wed Oct 26 2011 17:00:00 GMT-7

uchun 1319785200 uchun vaqt:

GMT: Fri, 28 Oct 2011 07:00:00 GMT
GMT-7: Fri Oct 28 2011 00:00:00 GMT-7

I've tried : gmdate("l, F jS, Y g:i a", "1319673600") but this give's em Wednesday, October 26th, 2011 5:00 pm

shuning uchun istagan narsa: GMT-7: Chr 26, 2011 17:00:00 GMT-7 formati

har qanday fikr?

rahmat

1

2 javoblar

Try DateTime and DateTimeZone

$dt = new DateTime(null, new DateTimeZone("US/Arizona"));
$dt->setTimestamp(1319673600);
echo $dt->format("r");
1
qo'shib qo'ydi
$timestamp = '1319673600';
$GMT_m_7 = date('D M d Y H:i:s', strtotime('- 7 hour', $timestamp));
echo $GMT_m_7;
1
qo'shib qo'ydi
Vaqt tamg'asini o'zgartirish emas vaqt zonasini o'zgartiradi
qo'shib qo'ydi muallif Phil, manba
PhP |BotsUz
PhP |BotsUz
93 ishtirokchilar

Phpni o'rganishni Hohlasangiz https://t.me/joinchat/AAAAAE-KRc5dd5tPMmGmWA A'zo bo'lin