function getUserIP()
$client = @$_SERVER[‘HTTP_CLIENT_IP’];
$remote = $_SERVER[‘REMOTE_ADDR’];

if(filter_var($client, FILTER_VALIDATE_IP))
$ip = $client;
elseif(filter_var($forward, FILTER_VALIDATE_IP))
$ip = $forward;
$ip = $remote;

return $ip;

$user_ip = getUserIP();

echo $user_ip.”   “; // Output IP address [Ex:]

$astring = str_replace(“.”,”,”,$user_ip);

$intg = array_map(‘intval’, explode(‘,’, $astring));

echo “\n\n”.”This is your voting number:   “. array_sum($intg).” – “;

//Get current time timestamp
$time_now = time();

//Create DateTime class object
$date = new DateTime();

//Set timestamp to DateTime object
$date->setTimestamp( $time_now );

//Set timezone so that code don’t get server’s timezone midnight time
$date->setTimezone(new DateTimeZone(‘Europe/Dublin’));

//Print current time in user’s timezone
//echo $date->format(‘Y-m-d H:i’) . “

//Get time stamp for midnight tonight
$date->modify(‘today midnight’);
$midnight_time = $date->getTimestamp();

//Print midnight time in user’s timezone
//echo $date->format(‘Y-m-d H:i’) . “

//Now you will need to subtract midnight time from current time in user’s timezone
$seconds_since_midnight = $time_now – $midnight_time;

echo date(‘y’, strtotime(‘-2000 year’));
echo date(‘m’, strtotime(‘-0 month’));
echo date(‘d’, strtotime(‘-0 day’));
//Print seconds since midnight in your timezone
echo $seconds_since_midnight;



We're not around right now. But you can send us an email and we'll get back to you, asap.


Log in with your credentials

Forgot your details?

Proudly powered by WordPress and BuddyPress | Terms | Privacy   -  Copyright © 2012 - 2024     Ballynagran Energy Plus  and  The Owner  -   All Rights Reserved.