If the date is coming from a database, there might be a
function/format already for that...
And http://php.net/date may also have a format specifier for Quarter.
If not, try this:
$quarter = ((int) ($month / 4)) + 1;
On Sat, June 30, 2007 10:14 am, revDAVE wrote:
> I have segmented a year into
Well then after or before that you have to check that the month value is
between 1 and 12 to make sure there's no input errors, then what if you ever
want ot change the quarters yeah anway I just wanted an excuse to tell
people to go low tech and use a switch, it's only 12 entries, and you c
of course ceil( month / 3 );
--
/Thunis
Don't panic.
--The Hitchikers Guide to the Galaxy
Fredrik Thunberg skrev:
$q = ceil( month / 4 );
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$q = ceil( month / 4 );
--
/Thunis
The ships hung in the sky in much the same way that bricks don't.
--The Hitchikers Guide to the Galaxy
revDAVE skrev:
I have segmented a year into four quarters (3 months each)
nowdate = the month of the chosen date (ex: 5-30-07 = month 5)
Q: What is the
At 6/30/2007 08:14 AM, revDAVE wrote:
I have segmented a year into four quarters (3 months each)
nowdate = the month of the chosen date (ex: 5-30-07 = month 5)
Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen
date falls on?
Result - Ex: 5-30-07 = month 5 and should f
I have segmented a year into four quarters (3 months each)
nowdate = the month of the chosen date (ex: 5-30-07 = month 5)
Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen
date falls on?
Result - Ex: 5-30-07 = month 5 and should fall in quarter 2
--
Thanks - RevDave
Ron Piggott (PHP) wrote:
>I have one more date based question.
>
>I have a month field ( $month ) and a day field ( $day ) being submitted
>by a form.
>
>I have a third field to be used as a date reminder for the information
>which was submitted as part of the form. It is a reminder to complete a
I have one more date based question.
I have a month field ( $month ) and a day field ( $day ) being submitted
by a form.
I have a third field to be used as a date reminder for the information
which was submitted as part of the form. It is a reminder to complete a
task for the date was which was
Wouldn't just making the script get 2 time stamps be more efficient, since you
are creating the database calls anyways? Or am I over simplifying it?
// current time at start of script
$before = strtotime("now");
//All your DB stuff
{
}
// current time at end of script
$after = strtotime("
Hi,
Friday, October 29, 2004, 7:19:09 AM, you wrote:
MT> Ok, so here is what I have. Please check to see if there is a better
MT> way. There are a lot of database calls to me.
MT> $database_name = "CETechnology";
MT> $host = "server";
MT> $login = "username";
MT> $password = "password";
MT> $e
-- Original message from Mike Tuller <[EMAIL PROTECTED]>: --
> Ok, so here is what I have. Please check to see if there is a better
> way. There are a lot of database calls to me.
There are. Do it in one query.
>
> $query = "SELECT * FROM hardware_assets WHERE etherne
Ok, so here is what I have. Please check to see if there is a better
way. There are a lot of database calls to me.
$ethernet_address = "00:01:93:8e:69:50";
$db_connect = mysql_connect( $host, $login, $password ) or die
(mysql_error());
$db_select = mysql_select_db($database_name) or die (mysql_
Hi,
Friday, October 29, 2004, 4:51:20 AM, you wrote:
MT> I have a shell script that inserts the unix date and time that the
MT> script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT
MT> 2004. I would like to have my web page do the math so that it displays
MT> the time since the
I guess.
Are you telling me that I should take the timestamp, convert it to
epoch time, the us the time function to get the current epoch time,
then subtract the timestamp epoch time from the current epoch time? I
think that is what you are saying.
I know I can get the current epoch time in php
[snip]
I have a shell script that inserts the unix date and time that the
script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT
2004. I would like to have my web page do the math so that it displays
the time since the script ran. How can I do the math so that the web
page will d
I have a shell script that inserts the unix date and time that the
script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT
2004. I would like to have my web page do the math so that it displays
the time since the script ran. How can I do the math so that the web
page will display
[snip]
That's not quite what I am talking about. I looked at that already.
I can could also put the date and time that the script was ran into the
MySql database by have a TIMESTAMP field in the database.
[/snip]
You can use that to convert your time in the DB, get the current time
when seeking
That's not quite what I am talking about. I looked at that already.
I can could also put the date and time that the script was ran into the
MySql database by have a TIMESTAMP field in the database.
I would like to compare the date and time of timestamp in the database
to the current time and com
Yes, will be OK with all dates (though the valid range of a timestamp is
typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07
GMT.)
The function you want for numeric dates is:
int mktime ( int hour, int minute, int second, int month, int day, int year)
so, in your example (1s
Dear Stephen,
Good clue!!
Is it working allways without problem such as 29 feb?
And one more hel how can I write "1 2 2003" instead of "1 february 2003"
I wrote but directly but doesn' t work
thanks
"Stephen Willcock" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTEC
Try:
$today = strtotime ("1 february 2003");
$enddate = strtotime ("2 february 2003");
$diff = $enddate - $today;
Should give you a clue!
SW
"Qt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear Kevin,
>
> I used timestamp allready as following;
>
> $tod
Dear Kevin,
I used timestamp allready as following;
$today = strtotime ("1 february 2003");
$enddate = strtotime ("1 march 2003");
$diff = $enddate - $today;
But result comes as
2419200
How can I convert that numbers to days
Best Regards
"Kevin Waterson" <[EMAIL PROTECTED]> wrote in messa
This one time, at band camp,
"qt" <[EMAIL PROTECTED]> wrote:
> Dear Sirs,
>
> How can I add or subtract two date easily. Is therea any lib or function
> about this. I can not find any easy way in the manual
if the dates are timestamps, simply
$new = $timestamp2 - $timestamp1;
cheers
Kevin
--
Dear Sirs,
How can I add or subtract two date easily. Is therea any lib or function
about this. I can not find any easy way in the manual
Best Regards
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gary,
Yes. Check the manual for mktime(); and getdate();
http://www.php.net/quickref.php
James
> Is there a way to do calculations with dates? Preferably ignoring
weekends.
>
> Thanks, Gary
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
>
Is there a way to do calculations with dates? Preferably ignoring weekends.
Thanks, Gary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
26 matches
Mail list logo