date() i mktime() problem
3 отговора
87 прегледа
date() i mktime() problem
Здравейте,
Имам някакъв проблем с функциите date() i Mktime.
$rr=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")-33));
Работи.
$rr=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")-36));
Не работи .
Ако числото което изваждам от годината е по-голямо от 35 ми дава :
Warning: unexpected error in date() in.....
Идеята е да взема всички години в някакъв интервал.
Имам някакъв проблем с функциите date() i Mktime.
$rr=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")-33));
Работи.
$rr=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")-36));
Не работи .
Ако числото което изваждам от годината е по-голямо от 35 ми дава :
Warning: unexpected error in date() in.....
Идеята е да взема всички години в някакъв интервал.
Re: date() i mktime() problem
ами ако не се лъжа, таймстампа който използваш (мктиме()) започва от 1.1.1970 година, така че 2004-36=1968 г. май... а що требе да го генерираш с мктиме(), като може да си го сглобиш от стрингове?
Just a genius
Re: date() i mktime() problem
във WIN ограничението ти 1970 година.
-----------------------
гърбавия - ковчег ще го изправи
-----------------------
гърбавия - ковчег ще го изправи
Re: date() i mktime() problem
int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]])
Warning: Note the strange order of arguments, which differs from the order of arguments in a regular UNIX mktime() call and which does not lend itself well to leaving out parameters from right to left (see below). It is a common error to mix these values up in a script.
Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970) and the time specified.
...
Колеги, съветвам ви да четете - то всичко си го пише
Ето един според мен доста добър референс в chm формат
[линк]
Съветвам ви да си го изтеглите и да си праите справки преди да питате в клуба
Warning: Note the strange order of arguments, which differs from the order of arguments in a regular UNIX mktime() call and which does not lend itself well to leaving out parameters from right to left (see below). It is a common error to mix these values up in a script.
Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970) and the time specified.
...
Колеги, съветвам ви да четете - то всичко си го пише
Ето един според мен доста добър референс в chm формат
[линк]
Съветвам ви да си го изтеглите и да си праите справки преди да питате в клуба