Hi, Guest! Soat:23:41
Home | Kirish | A`zo bo`lish
Php da vaqt va kun
getdate( ) - vaqt va kun haqida habar beradi massiv ko'rinishida quyidagi kalit so`zlar ishlatiladi.

seconds Sekunt (0-59)

minutes Minut (0-59)

hours Soat (0-23)

mday Oy (1-31)

wday Hafta (0-6), yakshanbadan bo`shlanadi

mon oy (1-12)

year Yil

yday yil (0-365)

weekday Hafta kunlari (misol, Friday)

month Oy kunlari (misol, January)

0 Joriy vaqi


Misol 1.

<html>

<head>

<title>Misol getdate()</title>

</head>

<body>

<?php

$d = getdate();

foreach ( $d as $key => $val )

echo "$key = $val<br>";

echo "<hr>Bugun: $d[mday].$d[mon].$d[year]";

?>

</body>

</html>

misol 1 natija:
seconds = 21 minutes = 4 hours = 12 mday = 10 wday = 4 mon = 11 year = 2005 yday = 313 weekday = Thursday month = November 0 = 1131613461

Bugun: 18.11.2019

date( ) - kun va vaqt formati

a "am" yoki "pm"

A "AM"yoki "PM"

d oy kuni (01-31)

D Qisqartirilgan oy kunlari (3-harf dan iborat)

F Oy kunlarining to`liq ko`rinishi

g Soat (12-formatda)

G Soat (24-formatda)

h Soat (12-format)

H Soat (24-format)

i Minut (00-59)

j oy kunlari (1-31)

l Hafta to`liq nomda

L Kasbiy yil (0 или 1)

m hafta (01-12)

M hafta kunlari (3-harfda)

n hafta (1-12)

s Sekunt (00-59)

t Oy kunlari ( dan 28 gacha 31)

U Joriy vaqt

w Hafta kunlari (0 - yakshanba, 6 - shanba)

y Yil (2 darajada)

Y Yil (4 darajada)

z Yil kunlari (0-365)

Z (dan -43200 gacha 43200)

Misol 2.

<html>

<head>

<title>Misol2 date()</title>

</head>

<body>

<?php

echo date( "Bugun: d.m.y H:i" );

?>

</body>

</html>
Comments (0)
Home|FM|
Hozir saytdagilar: 0 / 1

JAVAUZ.NET 2014-2017 © Designed by BEST_MIX