--- Scott Fletcher [EMAIL PROTECTED] wrote:
When I do this script, I didn't get a : and numbers in second.
--snip--
date(Y-m-d H:i:s);
--snip--
But when I do this script by adding a period to it, it worked okay.
--snip--
date(Y-m-d H:i:s.);
--snip--
Either this is a bug, or you're
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
When I do this script, I didn't get a : and numbers in second.
--snip--
date(Y-m-d H:i:s);
--snip--
works fine with phpversion() 4.2.2
Curt
--
If eval() is the answer, you're almost certainly asking the
wrong question. -- Rasmus
Thanks to all, it help me a lot
manisha
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a date returned from MySQL in '-MM-DD' format, i want to show
this date in 'DD/MM/' format using PHP, date() function does the same if
i pass timestamp in int format, but how to convert into int timestamp ?
e.g from '2003-11-25' to '20031125' ? and
Then I believe that i can use
Manisha Sathe wrote:
I have a date returned from MySQL in '-MM-DD' format, i want to show
this date in 'DD/MM/' format using PHP, date() function does the same if
i pass timestamp in int format, but how to convert into int timestamp ?
e.g from '2003-11-25' to '20031125' ? and
Then I
On Tuesday, November 25, 2003, at 01:42 PM, Manisha Sathe wrote:
I have a date returned from MySQL in '-MM-DD' format, i want to
show
this date in 'DD/MM/' format using PHP, date() function does the
same if
i pass timestamp in int format, but how to convert into int timestamp
?
e.g
Martin Cameron wrote:
$ndays=14;
function get_next_dates($ndays)
{
$today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y)));
$forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y)));
print h1$today === $few_days === $forward_date/h1;
for($i=0;$i$ndays;$i++)
{
Hi
I want to get the last date in a week.
Is there anybody who know how i can do this.
something like this:
function date getDateFromWeek( $week, $year){
...
...
return date;
}
- Petter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hey--
Maybe this will help:
http://www.phparch.com/mailinglists/msg.php?a=557061
Cheers,
Marco
Fredrik wrote:
Hi
I want to get the last date in a week.
Is there anybody who know how i can do this.
something like this:
function date getDateFromWeek( $week, $year){
...
...
return
Beautiful,
many thanks
Ahbaid.
Martin Cameron wrote:
$ndays=14;
function get_next_dates($ndays)
{
$today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y)));
$forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y)));
print h1$today === $few_days === $forward_date/h1;
Hello all,
I would like to create a php function as follows:
function get_next_dates($ndays) {
/*
1. get the current date
2. create an array say $results
3. Store the dates for the next $ndays in $results
*/
return $results
}
So in my main program I can include the file with
quote
Hello all,
I would like to create a php function as follows:
function get_next_dates($ndays) {
/*
1. get the current date
2. create an array say $results
3. Store the dates for the next $ndays in $results
*/
return $results
}
So in my main program I can
$ndays=14;
function get_next_dates($ndays)
{
$today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y)));
$forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y)));
print h1$today === $few_days === $forward_date/h1;
for($i=0;$i$ndays;$i++)
{
Does date() give the local time of the Server? or is it based on something
else?
Because I have this code:
echo date (F n, Y);
and it should say November 14, 2003 but it echos November 11, 2003. 3 days
behind.
Is the date wrong on the server? or is this something I can fix?
--
PHP General
[snip]
echo date (F n, Y);
[/snip]
Should be;
echo date(F d, Y);
n - Numeric representation of a month, without leading zeros
read carefully http://www.php.net/date
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, Nov 14, 2003 at 10:51:57AM -0500, Chris Mach wrote:
:
: Does date() give the local time of the Server? or is it based on
: something else?
The server.
: Because I have this code:
:
: echo date (F n, Y);
:
: and it should say November 14, 2003 but it echos November 11, 2003.
: 3 days
--- Chris Mach [EMAIL PROTECTED] wrote:
Does date() give the local time of the Server?
date() formats a timestamp, and it uses the current timestamp (whatever
time() would return) when you don't specify one. Yes, an incorrect server
time will give you an incorrect formatted date.
Hope that
Hello,
I have in a database a date field (this format yyy/mm/dd). I'd like when I
display the value use an another format dd/mm/ (format in europ), could
you tell me if there is a format DateString function ?
Thanks,
Christian,
--
PHP General Mailing List (http://www.php.net/)
To
On Sat, 2003-11-08 at 11:45, Christian Ista wrote:
Hello,
I have in a database a date field (this format yyy/mm/dd). I'd like when I
display the value use an another format dd/mm/ (format in europ), could
you tell me if there is a format DateString function ?
Thanks,
Christian,
On Sat, 2003-11-08 at 15:21, Christian Ista wrote:
?php echo mysql_result($result_cat,0,CATC_DATE);?
a string like that : 2003-11-07 and I'd like display 07/11/2003
I usually do:
?
$query = SELECT UNIX_TIMESTAMP(datefield) as unixtime FROM table;
$timestamp = mysql_result($result, unixtime);
On Wednesday 22 October 2003 04:32, Paul Nowosielski wrote:
I need to get mysql or php to subtract the current date from
$date_posted(time stamp) and return the number of days(the item has been
posted) as a sum.
Use the MySQL function TO_DAYS(). Not sure what you mean by as a sum.
--
Jason
Hello,
Can some lend advice regarding date functions using mysql and php
please?
I have a table set up like so
(DESCRIBE nuke.position)
hiddenid int(5) PRI NULL auto_increment
id varchar(40)
contact_email varchar(64)
title varchar(60)
salary mediumtext
how can I format the current date and time so that I can insert it into a
mysql table with an insert query?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
To: [EMAIL PROTECTED]
Subject: [PHP] date for mysql[Scanned]
how can I format the current date and time so that I can insert it into a
mysql table with an insert query?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List
On Fri, Oct 17, 2003 at 03:28:50PM +0200, Diana Castillo wrote:
:
: how can I format the current date and time so that I can insert it into a
: mysql table with an insert query?
That depends on the column type of your MySQL table. Is it a DATETIME?
DATE? TIMESTAMP? TIME? Or just a YEAR?
Hi,
I'm just screwing around with the date() function and timestamps but have
run into a little logic problem...
So far (as you can see with the below posted code) I can manipulate
days,hours and minutes...any idea on how to do months and years?
Lastly the goal of this is to make take all the
| www.amazon.com/o/registry/EGDXEBBWTYUU
- Original Message -
From: Ryan A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, 16 October, 2003 15:42
Subject: [PHP] PHP Date()ing logic.
Hi,
I'm just screwing around with the date() function and timestamps but have
run into a little
Hi,
is there a function in PHP that will work out the amount of time(hours)
beween two different dates / times?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- Shaun [EMAIL PROTECTED] wrote:
is there a function in PHP that will work out the amount of time(hours)
beween two different dates / times?
You can just subtract the timestamps the find the number of seconds between any
two times. PHP has a rich set of functions to help you generate
Hi,
I'm trying to find a formula for displaying the date for every Friday of a
given year, i.e. 2003
Jan 3, 2003
Jan 10, 2003
Jan 17, 2003
etc.
Any ideas?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sure --
?
$this_date = 1/1/2003;
for($i=1; $i=365; $i++) {
if (date(l, strtotime($this_date) == Friday)) {
echo $this_date . br;
}
$this_date = date(n/j/Y,mktime(0,0,0,date(m,
strtotime($this_date)),date(d, strtotime($this_date))+1,date(Y,
strtotime($this_date;
}
?
Sorry I had a parentheses out of place, it should have been:
?
$this_date = 1/1/2003;
for($i=1; $i=365; $i++) {
if (date(l, strtotime($this_date)) == Friday) {
echo $this_date . br;
}
$this_date = date(n/j/Y,mktime(0,0,0,date(m,
strtotime($this_date)),date(d,
How about something similar, but look for the first Friday and then add
seven days (or 604800 seconds) to get the date of the next Friday?
-Original Message-
From: J Morton [mailto:[EMAIL PROTECTED]
Sent: Friday, 3 October 2003 11:20 AM
To: Shew; [EMAIL PROTECTED]
Subject: Re: [PHP] date
Hi Justin,
Most Xcellent. Thanks alot!!!
Shew
J Morton [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Sorry I had a parentheses out of place, it should have been:
?
$this_date = 1/1/2003;
for($i=1; $i=365; $i++) {
if (date(l, strtotime($this_date)) == Friday) {
Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 3:18 AM
To: 'J Morton'; Shew; [EMAIL PROTECTED]
Subject: RE: [PHP] date brain teaser
How about something similar, but look for the first Friday and then add
seven days (or 604800 seconds) to get the date
Apologies if this has been asked before but I couldn't find
anything on google or any of the PHP code sites that quite fits my
requirements. Here's the problem:
I have a form which presents the user with a table of dates with
checkboxes for a three month period, e.g.
Dec 7th 14th
Try using any of the sort functions:
sort
asort
arsort
ksort
krsort
...
That should get you started.
--
Ray
On Wed, 2003-10-01 at 07:18, Greg Wiley wrote:
Apologies if this has been asked before but I couldn't find
anything on google or any of the PHP code sites that quite fits my
On Wednesday 01 October 2003 21:18, Greg Wiley wrote:
Apologies if this has been asked before but I couldn't find
anything on google or any of the PHP code sites that quite fits my
requirements. Here's the problem:
I have a form which presents the user with a table of dates with
checkboxes
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
[problem snipped]
Incorporate whatever sorting info you need into the value of
the checkbox.
input type=checkbox
name=Dec 28 am
value=insert timestamp for Dec 28 or whatever
Thanks, someone
-Original Message-
From: Greg Wiley [mailto:[EMAIL PROTECTED]
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
[problem snipped]
Incorporate whatever sorting info you need into the value of
the
checkbox.
input type=checkbox
name=Dec
Jon Kriek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Well I meant just
putenv('TZ=US/Eastern');
But you get the idea.
--
Jon Kriek
http://phpfreaks.com
Jon Kriek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
See the putenv() function. For example to get
putenv('TZ=Europe/London');
OR
putenv('TZ=GMT');
--
Jon Kriek
http://phpfreaks.com
Php Webmaster [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm in London and and my timezone is GMT, so what should I use?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Jon Kriek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
putenv('TZ=Europe/London');
OR
putenv('TZ=GMT');
--
Jon Kriek
http://phpfreaks.com
Php Webmaster [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm in London and and my timezone is GMT, so what should I
* Thus wrote PHP Webmaster ([EMAIL PROTECTED]):
Jon Kriek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
putenv('TZ=Europe/London');
OR
putenv('TZ=GMT');
--
Jon Kriek
http://phpfreaks.com
Php Webmaster [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all,
I currently use:
date(l jS F Y, g:i A);
To format the current date/time to my personal preference.
However, at 12:19 AM on my machine, date(l jS F Y, g:i A); shows 4:19PM...
8 hours slow :(
Any ideas on how to correct this? Am I right in saying that there is a
timezone problem?
Any
Sounds like your server is set to GMT, that is, if you are located in PDT timezone.
Warren Vail
-Original Message-
From: PHP Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 4:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date() is hours behind
Hi all,
I currently use
See the putenv() function. For example to get the correct Eastern Standard
Time
http://www.php.net/putenv
?php
putenv('TZ=US/Eastern');
echo 'Last modified: ' . date('d/m/y H:i', getlastmod());
?
--
Jon Kriek
http://phpfreaks.com
Php Webmaster [EMAIL PROTECTED] wrote in message
Well I meant just
putenv('TZ=US/Eastern');
But you get the idea.
--
Jon Kriek
http://phpfreaks.com
Jon Kriek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
See the putenv() function. For example to get the correct Eastern Standard
Time
http://www.php.net/putenv
?php
Hi,
Why does the following code print '00', surely it should print '08', I'm
baffled!
date(H, mktime(8, 0, 0, 0, 0, 0));
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* Thus wrote Shaun ([EMAIL PROTECTED]):
Hi,
Why does the following code print '00', surely it should print '08', I'm
baffled!
date(H, mktime(8, 0, 0, 0, 0, 0));
?php
echo date(r, mktime(8,0,0,0,0,0)), \n;
//Wed, 31 Dec 1969 23:59:59 +
echo date(r, mktime(0,0,0,0,0,0)), \n;
//Wed, 31
God i hope this is simple :)
I have news bloggs section on my site. At present the news is loaded in
from a txt file, most of the site is now running with most sections being
loaded via mysqldb's.
I would like to add the old entries to the new db that i have setup for the
bloggs.
My problem is
On Tue, Sep 23, 2003 at 09:01:19PM +0100, [ PAUL FERRIE ] wrote:
:
: God i hope this is simple :)
It is. I think. :-)
: I have news bloggs section on my site. At present the news is loaded in
: from a txt file, most of the site is now running with most sections being
: loaded via mysqldb's.
Cheers your a star :)
Eugene Lee [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Tue, Sep 23, 2003 at 09:01:19PM +0100, [ PAUL FERRIE ] wrote:
:
: God i hope this is simple :)
It is. I think. :-)
: I have news bloggs section on my site. At present the news is loaded in
:
On Sat, 6 Sep 2003, Nelson Goforth wrote:
Date.php calls for an include of a file called Span.php, but the file
does not exist in the date subdirectory. I've found some references to
that file being missing, so I located a file by that name in the CVS
directory and installed it. However,
I'm having difficulty with understanding how to manipulate dates. It
seems that there's no date object manipulate so we just pass around a
bunch of values which is kinda of annoying.
A few things I'm trying to do:
1) Turn MM/DD/YY into an array like that returned from getdate(). I
don't
On Sunday, September 7, 2003, at 02:50 PM, Seth Willits wrote:
A few things I'm trying to do:
1) Turn MM/DD/YY into an array like that returned from getdate(). I
don't want to explode it or split it, I want to get an array just as
if I used getdate() when the current day was MM/DD/YY.
It
Seth Willits wrote:
2) Have a date string representing the first of the month and
manipulate it to be the last day of the previous month.
You can use mktime() for this. To get the last day of a given month,
just give the parameters for the zeroth day of the next month. For
example, to get the
I am trying to use the Date class and am having trouble with it. Since
I'm just starting to use PEAR modules I'm not sure if I'm missing
something simple or just what.
Date.php calls for an include of a file called Span.php, but the file
does not exist in the date subdirectory. I've found
Howdy,
Has anyone written any date validation function or sequence. I have
looked around, but haven't found anything. I am cobbling togather
something, but was hoping to not have to re-invent the wheel. The date
is formatted MMDD and is input by the user;
$userCentury = substr($userDate, 0,
I wrote a little function to check if a date is valid. All the hard
stuff is done by the checkdate() function, but function just returns a
date if valid or false if not:
function validDate($year,$month,$day) {
if(checkdate($month,$day,$year)) {
return date(Y-m-d,
Jay Blanchard mailto:[EMAIL PROTECTED]
on Thursday, August 21, 2003 12:30 PM said:
Has anyone written any date validation function or sequence.
Now that I'm thinking about it, what is your goal with this? Is it to
make sure the date entered is within a certain range when compared to
another
[snip]
Now that I'm thinking about it, what is your goal with this? Is it to
make sure the date entered is within a certain range when compared to
another date? i.e. The date entered cannot be more than absolutevalue(10
days) away from the first date or is it just to make sure it's in the
proper
Jay Blanchard mailto:[EMAIL PROTECTED]
on Thursday, August 21, 2003 1:24 PM said:
It is to make sure that the user has entered a valid future date in
the MMDD format into the form.
(You may very well already know of these two functions and already
thought of what I'm going to tell you
[snip]
I'm thinking this:
1. you get the date from the user
2. validate it using checkdate()
3. get the current date
4. compare the two dates to see if the users date is later than todays
date
5. return true or return false
Sound good?
[/snip]
Sounds bueno! I am just tired, had checkdate() in
Hi all,
First of all, thanks to everyone who helped me with the checkbox
issue. I have an issue here while trying to INSERT INTO a MySQL table a
date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't
work.
What PHP function should I use?
Thanks in advanced,
Cesar Aracena
Cesar Aracena wrote:
Hi all,
First of all, thanks to everyone who helped me with the checkbox
issue. I have an issue here while trying to INSERT INTO a MySQL table a
date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't
work.
What PHP function should I use?
date('Ymd') to put
Ok so on a web application I needed to list the files in a directory,
ordered by last modified date.
I was pulling them out in an array, fetching the filemtime() for each
file, and trying to order them by that date. I was using asort() to sort
the files in an array so they'd list
On Wednesday 09 July 2003 01:51, Shena Delian O'Brien wrote:
[snip]
Well I gradually figured out that the date format output by filemtime()
was not an acceptable natural language date format. filemtime() was
fetching dates with a dash - ex. 07-08-2003. strtotime() was making
incorrect
Ahh, you're right! I had a rogue:
$date = date(m-d-Y, filemtime($fn));
in there. :) Thought I got rid of all of those in testing... my
organization has a standard date format and it must be dashes instead of
slashes, and of course it has to be month, day, year!
Jason Wong wrote:
On Wednesday
PROTECTED]
Sent: Tuesday, July 08, 2003 1:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date frustrations
Ok so on a web application I needed to list the files in a directory,
ordered by last modified date.
I was pulling them out in an array, fetching the filemtime() for each
file, and trying
On Jul 3, 2003, Garrick Linn claimed that:
|Hello all,
|
|I seem to be running into a problem where the date() function appears not
|to differentiate properly between unix timestamps.
|
|For example, the code:
|
|?php
|
|$seconds = 1054278483;
|echo $secondsbr;
|echo date(d-m-Y H:m:s, $seconds);
Hello all,
I seem to be running into a problem where the date() function appears not
to differentiate properly between unix timestamps.
For example, the code:
?php
$seconds = 1054278483;
echo $secondsbr;
echo date(d-m-Y H:m:s, $seconds);
echo brbr;
$seconds = ($seconds - 60);
echo $secondsbr;
:)
You are using an m where you want an i.
Regards,
Philip
On Thu, 3 Jul 2003, Garrick Linn wrote:
Hello all,
I seem to be running into a problem where the date() function appears not
to differentiate properly between unix timestamps.
For example, the code:
?php
$seconds =
Well, I got the time displaying sort of right but have a length problem. See, using %T
doesn't work in date() but %Z does but it returns a very long string 'Mountain
Daylight Time' when all I want is 'MDT'. Is there a way around this problem other than
having to edit the string date() returns??
echo(date('T'));
Works fine for me.
On Fri, 2003-06-27 at 13:03, Sparky Kopetzky wrote:
Well, I got the time displaying sort of right but have a length problem. See, using
%T doesn't work in date() but %Z does but it returns a very long string 'Mountain
Daylight Time' when all I want is
Opps! I meant strftime() as I have to pass timestamp from a file.
Sparky
- Original Message -
From: Adam Voigt [EMAIL PROTECTED]
To: Sparky Kopetzky [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 11:07
Subject: Re: [PHP] Date/Time problem
echo(date('T
I am storing dates in an Access database in a field with a Date/Time Type
the date is being generated using date(n/d/Y h:i a). It appears to be
stored in Access correctly but when I output it to the page using PHP it
seems to be changing. It is being stored in the database as 6/19/2003
1:44:00
I am storing dates in an Access database in a field with a Date/Time Type
the date is being generated using date(n/d/Y h:i a). It appears to be
stored in Access correctly but when I output it to the page using PHP it
seems to be changing. It is being stored in the database as 6/19/2003
1:44:00
Message-
From: Logan McKinley [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 5:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Date problem
I am storing dates in an Access database in a field with a Date/Time
Type
the date is being generated using date(n/d/Y h:i a). It appears to
be
stored
, 2003 6:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date question
Hi,
For a given date, how can i find out the date of the day of the begining
of that week?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP
On Thu, 29 May 2003 15:40:00 +0100, Shaun wrote:
of course ;)
but i couldn't find a reference to this particular problem...
I don't think you are going to find a standard PHP function to do this.
You are going to have to do something like this (I haven't tried it
but I think it will do what
://www.php.net ?
-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 6:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date question
Hi,
For a given date, how can i find out the date of the day of
the begining
of that week?
Have you tried searching
On Thursday 29 May 2003 22:40, Shaun wrote:
of course ;)
Try:
$start_date_ts = time();
if ('Mon' != date('D', $start_date_ts)) {
$start_date_ts = strtotime(last monday);
}
$start_date= strftime(%Y-%m-%d, $start_date_ts);
echo $start_date;
Season to taste.
Hi,
For a given date, how can i find out the date of the day of the begining of
that week?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Have you checked the date functions at http://www.php.net ?
-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 6:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date question
Hi,
For a given date, how can i find out the date of the day of the begining
Hi people,
I would like to select news from my database bases on week/year and
month/year.
How can i do this.. I would like to pass two arguments in the query
string, like news.php?week=14year=2003 or news.php?month=3year=2003.
Can anybody help me.. Thanks in advance. I have been looking at the
Check out mysql manual, section 6.3.4 - Date and Time Functions, example
$condition='';
if($GET['week']) $condition .= WEEK(date)='$_GET[week]' AND ;
if($GET['year']) $condition .= YEAR(date)='$_GET[week]' AND ;
and so on
then use the condition:
$sql = SELECT * FROM news WHERE $condition 1;
On Monday 31 March 2003 22:07, Davy Obdam wrote:
I would like to select news from my database bases on week/year and
month/year.
How can i do this.. I would like to pass two arguments in the query
string, like news.php?week=14year=2003 or news.php?month=3year=2003.
Can anybody help me..
Hi there, can anyone tell me how to fix my code so that on the last day of
the month, my code doesn't repeat the months...
What the code suppose to do is, makes a drop down box from which you can
select the month, and if its the current month
the box is already selected.
select name=month
?
for
Hi there, can anyone tell me how to fix my code so that on the last day of
the month, my code doesn't repeat the months...
I'm not sure what you mean by this, but I can be a moron on this list
sometimes and the clear answer usually comes to me about 2 seconds after I
hit the send button. Do you
change
for ($i=1; $i=12; $i++)
to
for ($i=1; $i12; $i++)
--- Vinesh Hansjee [EMAIL PROTECTED] wrote:
Hi there, can anyone tell me how to fix my code so
that on the last day of
the month, my code doesn't repeat the months...
What the code suppose to do is, makes a drop down
box from which
- Original Message -
From: Vinesh Hansjee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 6:55 AM
Subject: [PHP] Date Problem - Last Day Of Month
Hi there, can anyone tell me how to fix my code so that on the last day of
the month, my code doesn't repeat
Thanks Jason and Marek,
I was thinking to difficult, Thanks for the quick responses.
Best regards,
Davy Obdam
-Oorspronkelijk bericht-
Van: Jason Wong [mailto:[EMAIL PROTECTED]
Verzonden: maandag 31 maart 2003 16:36
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] date() and mktime
This leads me to another question. If I have stored the date as an
epoch then is there a way using PHP and MySQL to say find all the
records that have been added this YEAR (not last 365 days)?
SELECT * FROM table WHERE YEAR(FROM_UNIXTIME(column)) =
YEAR(CUR_DATE());
Benchmark each method and
I am storing my dates as unix timestamp (epoch). Am I right in assuming
that if I need to add or subtract days from this it is done in seconds?
So for example if I have the timestamp 1041397200 and I wanted to
subtract 24 hours from it I would do this:
$newtime = $orig_time - 86400;
Thanks,
On March 27, 2003 09:15 pm, Charles Kline wrote:
I am storing my dates as unix timestamp (epoch). Am I right in
assuming that if I need to add or subtract days from this it is
done in seconds?
yes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
I think there's problems doing that when daylight savings starts/ends
Just something to keep in mind...
-Original Message-
From: Leo Spalteholz [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] date math question
On March 27, 2003 09
Okay cool.
This leads me to another question. If I have stored the date as an
epoch then is there a way using PHP and MySQL to say find all the
records that have been added this YEAR (not last 365 days)?
Thanks
Charles
On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote:
On March 27,
hi,
$start = mktime ( 0, 0, 0, 1, 1, date['Y']); // first day of this year
$end = mktime ( 0, 0, 0, 12, 31, date['Y']); // last day of this year
then select all record where timestamp = $start and timestamp = $end
should do the job
Hope this helps
Foong
Charles Kline [EMAIL PROTECTED]
sorry
typo error should be:
date('Y')
Foong
Foong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi,
$start = mktime ( 0, 0, 0, 1, 1, date['Y']); // first day of this year
$end = mktime ( 0, 0, 0, 12, 31, date['Y']); // last day of this year
then select all record where
501 - 600 of 1042 matches
Mail list logo