[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Jim Giner
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 date

[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Jim Giner
BTW - this is the code I used to test out your process: ? $dt_format = D, M jS, Y g:i:s a; $todaydate = date($dt_format); $showenddate = strtotime(11/18/12 16:00:00); if ($todaydate $showenddate) echo The date of the show has not yet arrived; else echo The show has ended; -- PHP

[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Maciek Sokolewicz
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 -

[PHP] Re: Date validation

2011-05-23 Thread Pete Ford
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

[PHP] Re: Date validation

2011-05-23 Thread tedd
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

Re: [PHP] Re: Date validation

2011-05-23 Thread Pete Ford
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

Re: [PHP] Re: Date validation

2011-05-23 Thread Tamara Temple
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

Re: [PHP] Re: Date validation

2011-05-23 Thread Andrew Ballard
On Mon, May 23, 2011 at 9:55 AM, Tamara Temple tamouse.li...@gmail.com 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

[PHP] Re: Date validation

2011-05-21 Thread Geoff Lane
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

[PHP] Re: Date validation

2011-05-20 Thread Jo�o C�ndido de Souza Neto
What about using this: $date = DateTime::createFromFormat(Y-m-d, 2011-05-20); -- João Cândido de Souza Neto Geoff Lane ge...@gjctech.co.uk escreveu na mensagem news:11565581.20110520132...@gjctech.co.uk... Hi All, I'm scratching my head trying to remember how I validated string

[PHP] Re: Date validation

2011-05-20 Thread Geoff Lane
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 suspect

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
On 20 May 2011 16:22, Geoff Lane ge...@gjctech.co.uk 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

Re: [PHP] Re: Date validation

2011-05-20 Thread 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. -- João Cândido de Souza Neto Peter Lind peter.e.l...@gmail.com escreveu na mensagem news:banlktinjonyvfnqjqtfqtdmu_r2-cfp...@mail.gmail.com... On 20 May 2011

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
2011/5/20 João Cândido de Souza Neto j...@consultorweb.cnt.br: 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 -- hype WWW: plphp.dk /

[PHP] Re: Date validation

2011-05-20 Thread Geoff Lane
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 a

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
On 20 May 2011 16:47, Geoff Lane ge...@gjctech.co.uk 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

[PHP] Re: Date validation

2011-05-20 Thread Geoff Lane
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

[PHP] Re: Date validation

2011-05-20 Thread Geoff Lane
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

[PHP] Re: Date +30 comparison

2009-09-01 Thread Shawn McKenzie
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/2009' and

[PHP] Re: Date math

2008-03-24 Thread Bill Guion
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

[PHP] Re: date formatting

2007-08-30 Thread Haydar TUNA
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

[PHP] Re: Date Calculation Help

2007-06-30 Thread Oliver Jato
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 quarter

[PHP] Re: date format from a database date field

2007-05-23 Thread Johan Holst Nielsen
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?

Re: [PHP] Re: date() and timezone

2006-12-15 Thread Fernando M. M.
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. What you

Re: [PHP] Re: date() and timezone

2006-12-15 Thread Jochem Maas
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 guess there are

Re: [PHP] Re: date() and timezone

2006-12-15 Thread Fernando M. M.
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 through

Re: [PHP] Re: date() and timezone

2006-12-15 Thread Jochem Maas
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 something

[PHP] Re: date() and timezone

2006-12-14 Thread Jonesy
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 something on

Re: [PHP] Re: date() and timezone

2006-12-14 Thread Jochem Maas
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 there a way to set

[PHP] Re: date(n/Y) strtotime

2006-08-02 Thread Adam Zey
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

[PHP] Re: Date addition problem

2006-03-29 Thread David Robley
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 reason

[PHP] Re: Date Question

2006-03-17 Thread João Cândido de Souza Neto
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 the

Re: [PHP] Re: Date Question [SOLVED]

2006-03-17 Thread Tom Chubb
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: Please can you help

[PHP] Re: Date question

2006-02-24 Thread William Stokes
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 against2006-02-24

[PHP] Re: date processing needed in form

2006-01-03 Thread Manuel Lemos
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

[PHP] Re: date processing needed in form

2006-01-03 Thread Jerry Kita
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

[PHP] Re: date of file?

2005-09-11 Thread Michelle Konzack
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.

[PHP] Re: date field

2005-08-11 Thread John Taylor-Johnston
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

[PHP] Re: date field

2005-08-10 Thread Ben Ramsey
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

Re: [PHP] Re: date problem

2005-06-29 Thread Mario netMines
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: php-general@lists.php.net Sent: Wednesday, June 29, 2005 7:49 AM Subject: Re: [PHP] Re: date problem Mario netMines wrote

[PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
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

Re: [PHP] Re: date problem

2005-06-28 Thread Mario netMines
, 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 shouldn't

Re: [PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
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

[PHP] Re: Date() reporting wrong on OS X server intermittently

2005-02-17 Thread Jason Barnett
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 your

[PHP] Re: Date Update

2005-02-04 Thread Jason Barnett
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

Re: [PHP] Re: Date()

2005-01-17 Thread Steve Buehler
At 08:33 PM 1/15/2005, you wrote: Torsten, Whatever the combination, it echos February 02-2005brFebruary 02-2005brFebruary 02-2005. What is wrong with it? ?php $week5 = 2005-02-14; $firstDayTs = strtotime($week5); $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . '

[PHP] Re: Date()

2005-01-15 Thread Torsten Roehr
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 $week0

[PHP] Re: Date()

2005-01-15 Thread John Taylor-Johnston
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

[PHP] Re: Date()

2005-01-15 Thread John Taylor-Johnston
Torsten, Whatever the combination, it echos February 02-2005brFebruary 02-2005brFebruary 02-2005. What is wrong with it? ?php $week5 = 2005-02-14; $firstDayTs = strtotime($week5); $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' .

[PHP] Re: Date-development stalled?

2005-01-02 Thread Matthew Weier O'Phinney
* 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 response

[PHP] Re: Date Conversions?

2004-11-15 Thread Matthew Weier O'Phinney
* 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 given and

Re: [PHP] Re: Date Conversions?

2004-11-15 Thread Robert Sossomon
Matthew Weier O'Phinney is quoted as saying on 11/15/2004 3:01 PM: * Robert Sossomon [EMAIL PROTECTED]: SNIP 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,

[PHP] Re: Date and time

2004-08-11 Thread Aidan Lister
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 =

[PHP] Re: Date and time

2004-08-11 Thread Aidan Lister
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 add 7

Re: [PHP] Re: Date and time

2004-08-11 Thread Matthew Sims
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 add 7

[PHP] Re: date difference

2004-07-15 Thread Torsten Roehr
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.1970 in

[PHP] Re: Date Diff function

2004-06-28 Thread Torsten Roehr
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 server. Best

[PHP] Re: Date Select

2004-06-25 Thread pete M
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

[PHP] Re: Date Select

2004-06-25 Thread Gerben
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 field?

[PHP] Re: Date Function - Empty Value

2004-05-20 Thread Gabe
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 DB W2K IIS 5

[PHP] Re: Date Function - Empty Value

2004-05-20 Thread Torsten Roehr
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

Re: [PHP] Re: Date Function - Empty Value

2004-05-20 Thread Mark Pecaut
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 Access for my

Re: [PHP] Re: Date Function - Empty Value

2004-05-20 Thread 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

[PHP] Re: Date Function - Empty Value

2004-05-20 Thread Gabe
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

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
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've tried

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
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.

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Matt Matijevich
[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

Re: [PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
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.

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
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 DB W2K IIS 5

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
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 (

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
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 ( m/d/ ).

[PHP] Re: date()

2004-03-19 Thread Andre Cerqueira
is that all? Khalid Judeh wrote: hello all, i am new to php, i am trying to call the date function this way: ?php echo date(d/m/y); ? and the result i get is: object18/03/04 any help would be appreciated Khaled Jouda cell. phone:

[PHP] Re: date()

2004-03-19 Thread Eric Gorr
Khalid Judeh wrote: hello all, i am new to php, i am trying to call the date function this way: ?php echo date(d/m/y); ? 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

[PHP] Re: date() before 1 Jan 1970...

2004-03-08 Thread Ben Ramsey
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: quote Note: The valid range of a

[PHP] Re: date() before 1 Jan 1970...

2004-03-08 Thread Ben Ramsey
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

[PHP] Re: date functions

2004-02-25 Thread David Robley
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 in some

[PHP] Re: date

2004-02-20 Thread Lucian Cozma
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), yesterday would be

Re: [PHP] Re: date

2004-02-20 Thread Richard Davey
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(-1 day); --

Re: [PHP] Re: date() funtion language

2004-02-13 Thread André Cerqueira
-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

Re: [PHP] Re: date() funtion language

2004-02-13 Thread André Cerqueira
-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:

Re: [PHP] Re: date() funtion language

2004-02-12 Thread Don Read
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 snip //the follow should, but doesnt seem to work

[PHP] Re: date() funtion language

2004-02-11 Thread André Cerqueira
-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: ? $wdayname_array = array('Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado');

[PHP] Re: Date comparison

2004-02-04 Thread Michael Nolan
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

[PHP] Re: date for mysql

2003-10-17 Thread pete M
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

[PHP] Re: date problem

2003-09-24 Thread John
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', surely

Re: [PHP] Re: date problem

2003-09-24 Thread Robert Cummings
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(),

[PHP] Re: Date Validation, Kinda'

2003-08-21 Thread Scott Fletcher
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

[PHP] Re: date problem

2003-03-19 Thread Philip Hallstrom
Try: $ts = time(); $i = 0; while( $i 2 ) { $day = date(dS, $ts + $i * 86400); print(td$day/td); $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){ $day++;

[PHP] Re: Date Question.

2003-03-05 Thread Philip Hallstrom
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

Re: [PHP] Re: Date Question.

2003-03-05 Thread Sebastian
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 wrote:

Re: [PHP] Re: Date Question.

2003-03-05 Thread Kevin Stone
://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 05, 2003 12:32 PM Subject: Re: [PHP] Re: Date Question. can you give an example? I am stil

Re: [PHP] Re: Date Question.

2003-03-05 Thread Sebastian
Thank you very much, That worked well. warm regards, Sebastian. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: Sebastian [EMAIL PROTECTED]; Philip Hallstrom [EMAIL PROTECTED] Cc: php list [EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 2:38 PM Subject: Re: [PHP] Re: Date

[PHP] Re: date range assistance needed

2003-03-03 Thread Bobby Patel
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

[PHP] Re: date problem

2003-02-27 Thread R'twick Niceorgaw
$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

[PHP] Re: date, first of next month?

2003-02-27 Thread Bryan Koschmann - GKT
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 like

[PHP] Re: date, first of next month?

2003-02-26 Thread Philip Hallstrom
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, worked

[PHP] Re: Date/Time Logic

2003-02-19 Thread Philip Hallstrom
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

[PHP] Re: date calculation

2003-02-16 Thread Fred Merritt
Qt, The easiest way is to convert your dates into a serial day number(i.e. the number of days that have elapsed between your date, and some arbitrary date in the dim and distant past - I think PHP uses 25th November, -4714). There are some calendar functions in php that will do this for you.

Re: [PHP] Re: date calculation

2003-02-16 Thread olinux
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

Re: [PHP] Re: date calculation

2003-02-16 Thread qt
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

  1   2   >