jordanking
Programmer
- Sep 8, 2005
- 351
Hello,
This may be a simple one to answer. I am trying to build custom timestamps that are used to query a remote mysql database.
I want to be able to create a time stamp specific to the day, month, year, hour, minute, second.
I have the corresponding php code if the helps:
So what i am looking for is an equivilant of a "mkTime" function that allows you to specify values for each aspec of the timestamp as this values changes based on which day of the week it is.
This may be a simple one to answer. I am trying to build custom timestamps that are used to query a remote mysql database.
I want to be able to create a time stamp specific to the day, month, year, hour, minute, second.
I have the corresponding php code if the helps:
Code:
if(intval(date('w'))==0){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-2, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d')+1, date('Y'));
}elseif(intval(date('w'))==1){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-3, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d'), date('Y'));
}elseif (intval(date('w'))== 2){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-1, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d'), date('Y'));
}elseif (intval(date('w'))== 3){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-1, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d'), date('Y'));
}elseif (intval(date('w'))== 4){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-1, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d'), date('Y'));
}elseif (intval(date('w'))== 5){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-1, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d'), date('Y'));
}elseif(intval(date('w'))==6){
$last_cutoff = mktime(13, 0, 0, date('m'), date('d')-1, date('y'));
$cutoff = mktime(12, 59, 59, date('m'), date('d')+2, date('Y'));
}
So what i am looking for is an equivilant of a "mkTime" function that allows you to specify values for each aspec of the timestamp as this values changes based on which day of the week it is.