- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
// get today's date string as YYYY-MM-DD HH:MM:SS
function getDateTime(){
$datetime = getdate();
$mday = $datetime['mday'];
if ($mday<10){
$mday="0$mday";
}
$mon = $datetime['mon'];
if ($mon<10){
$mon="0$mon";
}
$year = $datetime['year'];
$mhour = $datetime['hours'];
if ($mhour<10){
$mhour="0$mhour";
}
$mmin = $datetime['minutes'];
if ($mmin<10){
$mmin="0$mmin";
}
$msec = $datetime['seconds'];
if ($msec<10){
$msec="0$msec";
}
$dateTime = "$year-$mon-$mday $mhour:$mmin:$msec";
return $dateTime;
}
guest 13.12.2008 04:13 # 0
ААаа.. ))
ну а че может человек не знал о date();
TheHamstertamer 31.05.2011 19:45 # 0
Govnocoder#0xFF 31.05.2011 20:44 # +1
guest8 23.09.2019 22:44 # −999
guest8 26.09.2019 20:38 # −999