Am proud of being a g33k! I do PHP Programming, *NIX, FreeBSD, MacOSX, White Water Rafting, Volleyball, PS3/PC Gaming, Travelling, and of course GADGETS!

Kuih Koci


Eksperimentasi KLCC & KL Tower View From Office

Eksperimentasi 60D di KLCC

Suria KLCC

Eksperimentasi

iOS 5 Beta 6

Have to update the iOS 5 Beta 6 manually via iTunes due to unavailability of OTA services on my iDevices. Weird if i tried to update via OTA, will display my iOS 5 is up to date but it’s actually running on iOS 5 Beta 4. Must be the beta thingie la kot

 

Juwi, Didi, Cinta

Mangsa-mangsa cubaan camera baru hehehe

Joran Pancing – Wardriving / Warchalking

Alfa 5dBi & TP-Link 8dBi in action

Function checkTime()

Disebabkan ada yang bertanya pasal function checkTime() yang digunakan dalam #WaktuSolat, camni rupanya :-


function checkTime($currentTime, $startTime, $endTime){

// written 11/26/2006 by Patrick H. ([email protected])

//

// the time passed must meet all the below criteria to return 1 (true):

//

// - current hour needs to be equal or greater than start hour

// - current hour needs to be equal or less than end hour

// - current minute needs to be equal or greater than start minute (if current hour is ok)

// - current minute needs to be equal or less than end minute (if current hour is ok)

//

// if any of those checks does not pass, it will return 0 (false)

 

global $cHour;

global $cMin;

global $sHour;

global $sMin;

global $eHour;

global $eMin;

 

// break up current time

$now = explode(":",$currentTime);

$cHour = intval($now[0]); // current time - hour

$cMin = intval($now[1]); // current time - minute

 

// break up start time

$start = explode(":",$startTime);

$sHour = intval($start[0]); // start of range - hour

$sMin = intval($start[1]); // start of range - minute

 

// brek up end time

$end = explode(":",$endTime);

$eHour = intval($end[0]); // end of range - hour

$eMin = intval($end[1]); // end of range - minute

 

// this is the variable used to track the result of the checks

$pass = true;

 

if($sHour <= $eHour){

// the range is on the same day

 

// compare to the start hour

if($cHour < $sHour){

$pass = false;

}

 

// compare to the end hour

if($cHour > $eHour){

$pass = false;

}

 

// compare to the start min

if($cHour == $sHour){

if($cMin < $sMin){

$pass = false;

}

}

 

// compare to the end min

if($cHour == $eHour){

if($cMin > $eMin){

$pass = false;

}

}

 

} else {

// the range is overnight, so the logic is a little different

 

if( ($cHour < $sHour) && ($cHour > $eHour) ){

$pass = false;

}

 

// compare to the start min

if($cHour == $sHour){

if($cMin < $sMin){

$pass = false;

}

}

 

// compare to the end min

if($cHour == $eHour){

if($cMin > $eMin){

$pass = false;

}

}

 

}

 

// done with check, return the result

if($pass == false){

return 0; // failed

} else {

return 1; // passed

}

 

}

Selamat mencuba!

Hello Canon EOS 60D

Say hello to the new gadget :)

CEH Certified :)

Alhamdulillah I’ve passed the CEH (Certified Ethical Hacker) exam. Banyak ilmu offensive hacking diajar masa training. Mudah2an ilmu tu berkat & dapat membantu.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Switch to our mobile site