Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=37580
Postga havola
End [821] [off]
ATOYAT, # ATOYAT (26.08.2018 / 23:29)
Hafta kunlarining nomlarini qanday chiqarsak böladi.
Misol
bugun soat: 23:30 sana: 26.08.2018 emas
bugun yakshamba soat sana....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 boshlanadi
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.09.2014
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>
*.Misol 2 natija:
*.Bugun: 18.09.14 21:33
Hafta kunlarining nomlarini qanday chiqarsak böladi.
Misol
bugun soat: 23:30 sana: 26.08.2018 emas
bugun yakshamba soat sana....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 boshlanadi
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.09.2014
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>
*.Misol 2 natija:
*.Bugun: 18.09.14 21:33