On 11-11-2012 22:47, Jim Giner wrote:
Besides the minor fact that the code has syntax errors, the problem with
it is your if is backwrads. The facts are: today is less than end date,
so your if should show "The show has ended" since you are asking if
today IS GREATER than the end date.
BTW - th
BTW - this is the code I used to test out your process:
$showenddate)
echo "The date of the show has not yet arrived";
else
echo "The show has ended";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 11/11/2012 1:30 PM, Terry Ally (Gmail) wrote:
Hi all,
I am having a problem with comparing time. I am using the following:
$todaydate = date("D, M jS, Y g:i:s a");
$showenddate = date("D, M jS, Y g:i:s a",
strtotime($showsRecord['end_date']));
if ($todaydate > $showenddate):
echo "The
On Mon, May 23, 2011 at 9:55 AM, Tamara Temple wrote:
> Isn't this typically why date selectors are used on the front end?
>
Not really. Date selectors are intended to make data entry easier on
the front end while allowing only valid date selections, but you can't
really rely on them.
* Most dat
Isn't this typically why date selectors are used on the front end?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 23/05/11 13:12, tedd wrote:
At 9:47 AM +0100 5/23/11, Pete Ford wrote:
Finally, for some applications I have made an AJAX (javascript + PHP)
implementation which provides feedback to the user as they type in the
date field: every time a character is typed in the box, the backend is
asked to p
At 9:47 AM +0100 5/23/11, Pete Ford wrote:
Finally, for some applications I have made an AJAX (javascript +
PHP) implementation which provides feedback to the user as they type
in the date field: every time a character is typed in the box, the
backend is asked to parse it and then format it in
On 20/05/11 16:29, Geoff Lane wrote:
On Friday, May 20, 2011, Peter Lind wrote:
Try:
$date = new DateTime($date_string_to_validate);
echo $date->format('Y-m-d');
Many thanks. Unfortunately, as I mentioned in my OP, the DateTime
class seems to be 'broken' for my purposes because it uses str
I'm posting here for completeness as I've now rolled my own date
validator (code follows my sig). It allows almost all valid 'English'
formats except ordinal day values (1st, 3rd, etc.) Because I'm in UK
and writing for a UK audience, I've parsed ambiguous dates as d/m/y.
Those writing for places w
On Friday, May 20, 2011, João Cândido de Souza Neto wrote:
> What about using regular expression to validate so using DateTime
> object to parse it if it?s a valid date?
Again, thanks.
For info, I only need to know that it's a valid representation of a
date on this occasion as I intend to use
On Friday, May 20, 2011, Peter Lind wrote:
> Try:
> $date = new DateTime($date_string_to_validate);
> echo $date->format('Y-m-d');
Many thanks. Unfortunately, as I mentioned in my OP, the DateTime
class seems to be 'broken' for my purposes because it uses strtotime()
to convert input strings to
On 20 May 2011 16:47, Geoff Lane wrote:
*snip*
>>> Also, AFAICT createFromFormat fails if the date is not formatted
>>> according to the first parameter. So, for example:
>>> Â $date = DateTime::createFromFormat('d M Y', '5/2/10')
>>> fails ... (at least, it does on my system :( )
>>>
>
>> I'm s
What about using regular expression to validate so using DateTime object to
parse it if it?s a valid date?
--
João Cândido de Souza Neto
"Geoff Lane" escreveu na mensagem
news:574766433.20110520154...@gjctech.co.uk...
On Friday, May 20, 2011, Peter Lind wrote:
>> This is pretty much as exp
On Friday, May 20, 2011, Peter Lind wrote:
>> This is pretty much as expected except that the second call to
>> date() - i.e. date('d M Y', $date) - outputs nothing.
> date() takes an int as second parameter - a timestamp. Not an object.
> And from a quick test it doesn't look like DateTime has
2011/5/20 João Cândido de Souza Neto :
> If you look carefully, you´ll notice that I´m using the DateTime object
> (default from PHP 5.2.0 or higher) not the function date.
If you look carefully, you'll notice that I replied to Geoff.
Regards
Peter
--
WWW: plphp.dk / plind.dk
LinkedIn: pli
If you look carefully, you´ll notice that I´m using the DateTime object
(default from PHP 5.2.0 or higher) not the function date.
--
João Cândido de Souza Neto
"Peter Lind" escreveu na mensagem
news:banlktinjonyvfnqjqtfqtdmu_r2-cfp...@mail.gmail.com...
On 20 May 2011 16:22, Geoff Lane wr
On 20 May 2011 16:22, Geoff Lane wrote:
>  On Friday, May 20, 2011, João Cândido de Souza Neto wrote:
>
>> What about using this:
>
>> $date = DateTime::createFromFormat("Y-m-d", "2011-05-20");
>
> Hi João, and thanks for your help.
>
> FWIW, I thought about that but it didn't work for me. On
On Friday, May 20, 2011, João Cândido de Souza Neto wrote:
> What about using this:
> $date = DateTime::createFromFormat("Y-m-d", "2011-05-20");
Hi João, and thanks for your help.
FWIW, I thought about that but it didn't work for me. On further
investigation, I'm now completely confused and
What about using this:
$date = DateTime::createFromFormat("Y-m-d", "2011-05-20");
--
João Cândido de Souza Neto
"Geoff Lane" escreveu na mensagem
news:11565581.20110520132...@gjctech.co.uk...
> Hi All,
>
> I'm scratching my head trying to remember how I validated string
> representation of
David Stoltz wrote:
> I'm really struggling with dates in PHP. (Yes, I tried reading the
> manual)...
>
> Can someone provide code that does this:
>
> Takes current date, assigns it to a variable (let's say $today)
> Then adds 30 days to $today variable
> Takes a string ($nexteval) like '8/26/200
At 12:17 AM -0400 3/24/08, Ron Piggott wrote:
I have this math equation this list helped me generate a few weeks ago.
The purpose is to calculate how many days have passed between 2 dates.
Right now my output ($difference) is 93.958333 days.
I am finding this a little weird. Does anyon
Hello,
You can DATE_FORMAT MySQL Command in your SQL Query. For example:
select DATE_FORMAT(yourdatetimefield,'%Y-%m-%d') from yourtable
--
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net
""Mike Ryan"" <[
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 fall in q
Mike Ryan wrote:
Sorry I am a bit of a newbie with php and hope this has not been aswered a
million times, but here it goes
I have a date base with a couple of date fields when I pull up and display
the fields it show 2007-05-21. the question I have is how to convert the
field to 05-21-2007?
Cu
Fernando M. M. wrote:
>
>> that will teach not to use global include files to init your apps.
>>
>> even if you we stuck with editing 10,000 scripts (btw it sounds very
> fishy
>> to 10,000 scripts with date() calls in them - can anyone say 'code
> reuse'?)
>> exactly how hard would it be to write
>
> that will teach not to use global include files to init your apps.
>
> even if you we stuck with editing 10,000 scripts (btw it sounds very
fishy
> to 10,000 scripts with date() calls in them - can anyone say 'code
reuse'?)
> exactly how hard would it be to write something that would go thr
Fernando M. M. wrote:
>
> Hello,
>
>
But like i said i have lots of scripts inside
> this
folder, is there a way to set something on .htaccess to change
> the timezone?
>> why? ;-)
>
> Because i can't set
> the timezone for every single script. Inside this folder and subfolders i
> g
Hello,
>>> But like i said i have lots of scripts inside
this
>>> folder, is there a way to set something on .htaccess to change
the timezone?
>>
>
> why? ;-)
Because i can't set
the timezone for every single script. Inside this folder and subfolders i guess
there
are about 10,000 scripts.
Jonesy wrote:
> On Thu, 14 Dec 2006 16:56:55 -0200 (BRST), Fernando M. M. wrote:
>> --=_20061214165655_35409
>> Content-Type: text/plain; charset="iso-8859-1"
>> Content-Transfer-Encoding: 8bit
>>
>> I´m using php5 here.
>>
>> But like i said i have lots of scripts inside this
>> folder, is the
On Thu, 14 Dec 2006 16:56:55 -0200 (BRST), Fernando M. M. wrote:
> --=_20061214165655_35409
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: 8bit
>
> I´m using php5 here.
>
> But like i said i have lots of scripts inside this
> folder, is there a way to set somethin
Mark Steudel wrote:
I've always been really amazed at how well strtotime works, but recently
ran into an issue where it couldn't figure out the date if it was a cc
exp date in long format, e.g. 1/2009. I was curious if anyone else has
run into this and how did they get around it, here was my solu
Adrian Bruce wrote:
> Hi
>
> I am having an unusual problem when trying to calculate dates in advance
> from a start date. the code below shows a loop where by on each run an
> increasing number of weeks is added to the start date, this works as
> expected up untill the 8th time where for some r
Thanks guys.
On 17/03/06, João Cândido de Souza Neto <[EMAIL PROTECTED]> wrote:
>
> select date_format(date,"%d/%m/%y") as date from table
>
> It'll show in 17/03/06 format
>
> select date_format(date,"%d/%m/%Y") as date from table
>
> It'll show in 17/03/2006 format
>
>
> Tom Chubb wrote:
>
> > P
select date_format(date,"%d/%m/%y") as date from table
It'll show in 17/03/06 format
select date_format(date,"%d/%m/%Y") as date from table
It'll show in 17/03/2006 format
Tom Chubb wrote:
> Please can you help me. I've created a page where problems are posted into
> a database and I am using
Yep. Nevermind...
(and back to sleep)
""William Stokes"" <[EMAIL PROTECTED]> kirjoitti
viestissä:[EMAIL PROTECTED]
> Hello,
>
> I have a datetime column in MySQL DB. How can I match to that column from
> php code if I only have the date information available.
>
> 2006-02-24 12:00:00 against
Sue wrote:
Hello -
I need to create a form that allows the user to select a Month, Day and
Year. I am also new to PHP and am wondering if there is a way for me to
display the contents of the Select list box (for the Day) based on the Month
that is selected (and Year), so that the valid numbe
Hello,
on 01/03/2006 06:41 PM Sue said the following:
I need to create a form that allows the user to select a Month, Day and
Year. I am also new to PHP and am wondering if there is a way for me to
display the contents of the Select list box (for the Day) based on the Month
that is selected (
Am 2005-09-11 03:08:22, schrieb [EMAIL PROTECTED]:
> In addition to reading the names of the files in a directory, I also
> need to read the date the file was modified.
filemtime()
Greetings
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack Apt. 9
Thanks Ben!
John
Ben Ramsey wrote:
In PHP, you could do something like:
$updated = strtotime($db_result['updated']);
$one_year_ago = strtotime('-1 year');
if ($updated < $one_year_ago) {
// updated date is older than a year ago
}
John Taylor-Johnston wrote:
I have a field 'updated
In PHP, you could do something like:
$updated = strtotime($db_result['updated']);
$one_year_ago = strtotime('-1 year');
if ($updated < $one_year_ago) {
// updated date is older than a year ago
}
John Taylor-Johnston wrote:
I have a field 'updated' How can I tell if the date is older t
Isn't DATEDIFF() a MySQL 4.x function? The server I'm using has 3.x and I
can't upgrade...
- Original Message -
From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, June 29, 2005 7:49 AM
Subject: Re: [PHP] Re: date problem
Mario
Mario netMines wrote:
> Hi Jasper and thanks for the quick reply.
>
> something tells me it's not a straightforward SQL query that I have to
> use here but a logic using PHP and SQL.
Please don't top-post.
It can be done in SQL quite easily, as can many things people use PHP
for. Go to the MySQL
2005 4:28 AM
Subject: [PHP] Re: date problem
Firstly, this shouldn't be in the PHP list, as you're asking for help
with SQL.
Mario netMines wrote:
carrental_from (datetime field)
carrental_to (datetime field)
carrental_price (datetime field) [rates are per hour]
carrental_price shoul
Firstly, this shouldn't be in the PHP list, as you're asking for help
with SQL.
Mario netMines wrote:
> carrental_from (datetime field)
> carrental_to (datetime field)
> carrental_price (datetime field) [rates are per hour]
carrental_price shouldn't be a datetime field, as it isn't a datetime val
Rowan Hick wrote:
...
>
> Has anyone out there seen weird problems like this before ?
>
> Many Thanks,
> Rowan
The other suggestions are good. If they don't pan out, check to see if
you use the function strtotime(). It has been buggy in a few versions
of PHP and may not be acting properly in
Adi Pramadi wrote:
Dear Friends,
I'm new in PHP programing, and i need a way to add date in php.
here is the sample
If today is 29/01/2005 (dd/mm/yy)
and i need to make an apointment for another 10 days
the date recorded sould be 08/02/2005 and not 39/01/2005
is there a way to do it in just like in
At 08:33 PM 1/15/2005, you wrote:
Torsten,
Whatever the combination, it echos "February 02-2005February
02-2005February 02-2005". What is wrong with it?
$week5 = "2005-02-14";
$firstDayTs = strtotime($week5);
$lastDayTs = $firstDayTs + (4 * 86400);
echo date('F', $firstDayTs) . ' ' . d
Torsten,
Whatever the combination, it echos "February 02-2005February
02-2005February 02-2005". What is wrong with it?
";
echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' .
date('Y',$lastDayTs) ."";
?>
John
Roehr wrote:
> "John Taylor-Johnston" <[EMAIL PROTECTED]> wrot
Don't know where my other post went, but I corrected it:
echo date('F', $firstDayTs) . ' ' . date('d', $firstDayTs) . '-' .
date('Y',$firstDayTs)
echo date('F', $firstDayTs) . ' ' . date('d', $lastDayTs) . '-' .
date('Y',$firstDayTs)
Thanks,
John
Torsten Roehr wrote:
> "John Taylor-Johnst
"John Taylor-Johnston" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I might be doing this backwards, but how do I extract the date from $week5
and display $week5 + 4 days. I would like to create a function so when I
pass
>
> echo displaydate($week5);
>
> it echos "February 14-18"
* Tmp <[EMAIL PROTECTED]>:
> It seems that development of Pear::Date has stalled. The package does has
> some major bugs when used with php5 - both in the main "Date" class and in
> "Date_Span". There has been filled a bug report as early as september
> 2004, but no fix has been made yet and no res
Matthew Weier O'Phinney is quoted as saying on 11/15/2004 3:01 PM:
* Robert Sossomon <[EMAIL PROTECTED]>:
http://php.net/strtotime
Specifically, try the following:
// $date is the date as pulled from the MySQL table
$convertedDate = date("m-d-y", strtotime($date));
Here's what I wound up using, in
* Robert Sossomon <[EMAIL PROTECTED]>:
> I have a date in format YY-MM-DD in a MySQL table. I need to pull it back to
> display it in either format: MM-DD-YY or Month Day, Year format.
>
> I can't figure out how to write the query to do it, and am not sure
> how to make PHP just parse the one giv
> There was a little mistake in the code I posted before, try this one:
>
> http://aidan.dotgeek.org/lib/?file=function.convert_timestamp.php
>
>
> "Diff Fannehh" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Hi,
>>
>> I have this date in timestamp format:
>>
>> $a= 2004081011415
There was a little mistake in the code I posted before, try this one:
http://aidan.dotgeek.org/lib/?file=function.convert_timestamp.php
"Diff Fannehh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have this date in timestamp format:
>
> $a= 20040810114155;
>
> I want to
That's a mysql timestamp, if you want to manipulate dates in PHP you'll need
to use unix timestamps.
You have a couple of options,
select unix_timestamp(myFld) as myFld from myTbl
Then just add 60*60*24*7 to it.
Or, parse it with:
function convert_timestamp ($timestamp)
{
$timestring = substr
"John Meyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
> Is there a function to determine the difference between two dates? I am
> asking so I can do some date verification for COPA.
Convert your dates to timestamps which will be 10-digit integers (the time
since 1.1.19
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Does anyone have a date-diff function in PHP that *doesn't* use Unix
> time stamps? I need to calculate differences between two date values,
> but the range well exceeds that which "date" supports on our serve
select * from table where TO_DAYS(date_field) > ( TO_DAYS(NOW()) -7 )
this will give the entries of the last 7 days (and the ones that are in the
future)
"Tom Chubb" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How can I query a MySQL table to get the latest results from a date f
select * from table where week(date_field) = ( week(now()) -1 )
Tom Chubb wrote:
How can I query a MySQL table to get the latest results from a date field?
Basically, I am inserting several records at a time at the end of each week.
I want to have a page that displays the results for the last week
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[
Mark Pecaut wrote:
On Thu, May 20, 2004 at 12:28:00PM -0400, Gabe wrote:
I'm trying to store a date in a date/time field using the short date
format ( m/d/ ). For some reason it won't let me post an empty
value to that field in the DB. I've tried using empty quotes ( "" )
I'm using Microsoft
On Thu, May 20, 2004 at 12:28:00PM -0400, Gabe wrote:
> >>I'm trying to store a date in a date/time field using the short date
> >>format ( m/d/ ). For some reason it won't let me post an empty
> >>value to that field in the DB. I've tried using empty quotes ( "" )
>
> I'm using
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Torsten Roehr wrote:
> > "Gabe" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Torsten Roehr wrote:
> >>
> >>
> >>>"Gabe" <[EMAIL PROTECTED]> wrote in message
> >>>news:[EMAIL PROTECTED]
> >>>
> >>>
>
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Environment:
PHP 4.3.6
Access D
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Torsten Roehr wrote:
>
> > "Gabe" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Torsten Roehr wrote:
> >>
> >>
> >>>"Gabe" <[EMAIL PROTECTED]> wrote in message
> >>>news:[EMAIL PROTECTED]
> >>>
> >>>
> >>
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Torsten Roehr wrote:
>
> > "Gabe" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Environment:
> >>PHP 4.3.6
> >>Access DB
> >>W2K IIS 5
> >>
> >>
> >>I'm trying to store a date in a date/time field using t
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Environment:
PHP 4.3.6
Access DB
W2K IIS 5
I'm trying to store a date in a date/time field using the short date
format (
Matt Matijevich wrote:
[snip]
Well, I would, but I can't seem to figure out how to export just the
structure out of access. Wouldn't NULL be allowed by default?
[/snip]
Do you have access to the mdb file? If you do you can just go into
design view of the table to find out the data definitions.
[snip]
Well, I would, but I can't seem to figure out how to export just the
structure out of access. Wouldn't NULL be allowed by default?
[/snip]
Do you have access to the mdb file? If you do you can just go into
design view of the table to find out the data definitions.
--
PHP General Mailin
Torsten Roehr wrote:
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Environment:
PHP 4.3.6
Access DB
W2K IIS 5
I'm trying to store a date in a date/time field using the short date
format ( m/d/ ). For some reason it won't let me post an empty
value to that field in the DB.
"Gabe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Environment:
> PHP 4.3.6
> Access DB
> W2K IIS 5
>
>
> I'm trying to store a date in a date/time field using the short date
> format ( m/d/ ). For some reason it won't let me post an empty
> value to that field in the DB. I'
Khalid Judeh wrote:
hello all,
i am new to php, i am trying to call the date function this way:
and the result i get is: object18/03/04
any help would be appreciated
hummm...very odd. I did the same thing and got:
19/03/04
Can you provide any more details? What version of PHP is being used?
(
is that all?
Khalid Judeh wrote:
hello all,
i am new to php, i am trying to call the date function this way:
and the result i get is: object18/03/04
any help would be appreciated
Khaled Jouda
cell. phone: 0163-2382758
fax: 1(801)439-125
Ben Ramsey wrote:
$old_date = mktime(0, 11, 18, 1, 1, 1903);
echo date("Y-m-d H:i:s", $old_date);
Argh! I had the numbers reversed. It should be:
$old_date = mktime(18, 11, 0, 1, 1, 1903);
But you get the idea...
--
Regards,
Ben Ramsey
http://benramsey.com
http://www.phpcommunity.org/wiki/Peo
Check out the manual:
http://www.php.net/strtotime
Theoretically, this should work:
$old_date = strtotime("January 1, 1903 18:11 pm");
echo date("Y-m-d H:i:s", $old_date);
But all that echoes is:
1969-12-31 18:59:59
On that manual page, you'll see the following note:
Note: The valid range of a t
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> Hi,
>
> You might already be fed up with my posts but I'm a complete PHP newbie and find
> these groups are the best way to learn! Anyway I have the database date in the
> format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when i
>> how do i make php give me yesterday's date?
>>
>> i tried
>>
>> date("Y-m-d")-1
LC> date('Y-m-d', time()- 60*60*24);
LC> You could also use mktime.
Someone has already advised you look at strtotime, but just incase you
haven't here is one way you can use it:
$yesterdays_timestamp = strtotime(
date('Y-m-d', time()- 60*60*24);
You could also use mktime.
Regards,
Lucian
"Madcat" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi there
>
> how do i make php give me yesterday's date?
>
> i tried
>
> date("Y-m-d")-1
>
> but if today would be the 1st of july (2004-07-01), yest
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
hmz...
i just tryed that... didnt work
tryed other locale strings, didnt work...
do i need something else to make it work?
running php4.3.4rc3 on windows
Don Read wrote:
On 12-Feb-2004 André Cerqueira wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
ohhh
thanks hehe
Don Read wrote:
On 12-Feb-2004 André Cerqueira wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
i had problems with locale
i think its safer to make a dayname and monthname array, and use
getdate(), than build the string yourself
On 12-Feb-2004 André Cerqueira wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> i had problems with locale
> i think its safer to make a dayname and monthname array, and use
> getdate(), than build the string yourself
>
>
> //the follow should, but doesnt seem to work
> //setloca
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
i had problems with locale
i think its safer to make a dayname and monthname array, and use
getdate(), than build the string yourself
like:
function date_wrapper($format, $timestamp=NULL)
{
global $wdayname_array, $monthname_array;
if
Burhan Khalid wrote:
BEOI 7308 wrote:
Hi
I want to substract $first_date to $second_date and print the result
this way :
xx days, xx hours, xx minutes
i tried (strtotime($second_date)-strtotime($first_date)) but what i
get is a timestamp and i dont know what to do with it
Is there already a
insert into table (date_created) values( now() )
;-)
pete
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?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
>From the documentation:
http://ca2.php.net/manual/en/function.mktime.php
"Date with year, month and day equal to zero is considered
illegal (otherwise it what be regarded as 30.11.1999, which
would be strange behavior)."
I think the point here to think about is that the date()
For me, on Windows, it won't work because Windows won't do anything prior to
1970.
On linux, I get 17 as the result. If I change the year to 2000, then I get
08 on both.
John
"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Why does the following code print '00', su
I did similiar posting about finding the last day of the month last week and
got some response. So, I'll just post some clipping from php.net for you.
If your machine support the php mktime() then you're in for luck. You can
find more info about it at php.net with the function, date() and mktime(
Try:
$ts = time();
$i = 0;
while( $i < 2 ) {
$day = date("dS", $ts + $i * 86400);
print("$day");
$i++;
}
On Wed, 19 Mar 2003, shaun wrote:
> hi,
>
> using date(dS); how can i can increase the days so that it shows
>
> 19th 20th 21st
>
> I have tried
>
> while ($i < 2){
>
OTECTED]>
Sent: Wednesday, March 05, 2003 2:38 PM
Subject: Re: [PHP] Re: Date Question.
| He's recommending something like this..
|
| $tmp = explode(' ', $date);
| if (date("Y-m-d") == $tmp[0]) // date format -mm-dd
| {
| echo "Today";
| }
|
manual/en/function.explode.php
http://www.php.net/manual/en/function.date.php
- Kevin
- Original Message -
From: "Sebastian" <[EMAIL PROTECTED]>
To: "Philip Hallstrom" <[EMAIL PROTECTED]>
Cc: "php list" <[EMAIL PROTECTED]>
Sent: Wednesday, March
can you give an example? I am stil learning :)
- Original Message -
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
| Strip off the H:i:s part using explode() and use date() to get an
| equivalent string for right now and if they match, today's the day.
|
| On Wed, 5 Mar 2003, Sebastian wro
Strip off the H:i:s part using explode() and use date() to get an
equivalent string for right now and if they match, today's the day.
On Wed, 5 Mar 2003, Sebastian wrote:
> I have a date field in mysql in this format: Y-m-d H:i:s
>
> I would like to echo "Today" if the date is today, can someone
I believe PHP and MySQL use two different definitions of the start of a time
stamp. One uses 1974 the other 1900 (I don't know exactly). If you echo
strtotime($attributes[startdate]) , UNIX_TIMESTAMP (datestamp)
Also, in your query you are looking for all headlines that have
strtotime($attributes
On Wed, 26 Feb 2003, Philip Hallstrom wrote:
|
|Use the w option of date() and loop through adding 86400 to $t until you
|get to a number between 1 and 5.
|
| w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
I may of gotten ahead of myself, but I tried it using if/else. Looks lik
$date_array=explode("-",$newdate);
$day = $date_array[2];
$month = $date_array[1];
$year = $date_array[0];
Or,
$timestamp - strtotime($newdate);
$today = getdate($timestamp);
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
"Alexander Tsonev" <[EMAIL PROTECTED]> wrote in
> On Wed, 26 Feb 2003, 1LT John W. Holmes wrote:
>
> |You would think strtotime("first of next month") would work, but it doesn't.
> |This does:
> |
> |$t = mktime(0,0,0,date('m')+1,1,date('Y'));
> |
> |Gives you timestamp of first day, next month. Format accordingly with
> |date().
>
> Thats great
Store the timestamp of their first login to a database. Also store the
number of days (3, 90, 365) that there account is valid. Setup a script
to nightly go through the database and for any records where:
first_login_timstamp + number_of_days < right_now
is true invalidate their login and send
No I am not using msql
"Olinux" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you're using a database, it may be able to take
> care of this for you. If you're using mysql:
>
> 6.3.4 Date and Time Functions
>
http://www.mysql.com/documentation/mysql/bychap
If you're using a database, it may be able to take
care of this for you. If you're using mysql:
6.3.4 Date and Time Functions
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions
olinux
--- Fred Merritt <[EMAIL PROTECTED]> wrote:
> Qt,
> The ea
1 - 100 of 170 matches
Mail list logo