我正在尝试创建一个方程式,使用直到月末的时间作为变量..任何建议?

When a user creates an account I have to manually activate some of its functionality (which I want). What I need to happen after its activation is take $someTIMEvar (days, min, seconds any will work) till the end of the month UPDATE/SET a DB entry. Then use $newTIMEvar (the DB entry) in an equation. After the end of the month this process dose not need to happen again.. any suggestions?

EDIT -- Ill try to be more clear. using my code

<?php
$end = strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00')) - 1; 
$now = time(); 
$numSecondsUntilEnd = $end - $now;

$num =  $dollar / $TOTAL_seconds_IN_month;//How do I get this as a function of the current month?
$new_num = $num * $numSecondsUntilEnd;
?>

How do I get it to only happen once.. then at the end of the month not happen again.. ?

Use a setting in database for the month after that you dont want to run that part of code. So that you can check like

//if(time() < strtotime('MONTH_Setting_IN_DB 23:59:59'))

Or If you don't have any problem in hard coding than you can put the month in your code like :

if(time() < strtotime('April 2014 23:59:59')) {
    // execute your code under this condition
}