Re: [PHP] Re: Date validation

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

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 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 p

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
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

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
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

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" escreveu na mensagem news:banlktinjonyvfnqjqtfqtdmu_r2-cfp...@mail.gmail.com... On 20 May 2011 16:22, Geoff Lane wr

Re: [PHP] Re: Date validation

2011-05-20 Thread Peter Lind
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

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

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 thr

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 > g

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.

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 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: > > > P

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: Sent: Wednesday, June 29, 2005 7:49 AM Subject: Re: [PHP] Re: date problem Mario

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

Re: [PHP] Re: date problem

2005-06-28 Thread Mario netMines
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. Mario - Original Message - From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]> To: Sent: Wednesday, June 29, 2005 4:28 AM Subject: [P

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-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

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]>: 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

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= 2004081011415

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

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

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.

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(

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-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-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 > > > //the follow should, but doesnt seem to work > //setloca

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()

Re: [PHP] Re: Date Question.

2003-03-05 Thread Sebastian
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"; | } |

Re: [PHP] Re: Date Question.

2003-03-05 Thread Kevin Stone
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

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 wro

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 > http://www.mysql.com/documentation/mysql/bychap

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 ea

Re: [PHP] Re: date question

2002-09-29 Thread Matt
> From: "Jonas Geiregat" <[EMAIL PROTECTED]> > Sent: Sunday, September 29, 2002 10:56 AM > Subject: [PHP] Re: date question > and If I want to calculate from given date the next month > like strtotime("next month") gives me the date of one month in advanced > from NOW > but I want to get the dat

RE: [PHP] Re: Date() Problem

2002-07-27 Thread John Holmes
> I store all dates in unix timestamp format. It's the easiest one to work > with, and it's easy to do things like "date + three days", because it's > just > a case of adding the right number of seconds to the current stamp. > > You don't have to split anything, or get substr()'s of anything...

Re: [PHP] Re: Date() Problem

2002-07-27 Thread Justin French
I store all dates in unix timestamp format. It's the easiest one to work with, and it's easy to do things like "date + three days", because it's just a case of adding the right number of seconds to the current stamp. You don't have to split anything, or get substr()'s of anything... and since da

RE: [PHP] Re: date

2002-07-24 Thread John Holmes
> I am not sure it works, since isn't tested, but here we go. It's pure > Mysql, and it would be probaly easier, faster, and more readable to do > with > PHP mixed. But where's the fun of it? ;-) > > date_field is the name of your date column. > > $sql = "SELECT IF(DAYOFMONTH(date_field) = DAY

Re: [PHP] Re: Date?

2002-06-09 Thread Bogdan Stancescu
JavaScript's getTimezoneOffset seems to be working just right, as shown here: http://www.tyzo.com/tools/timezone.html I think assuming that the user's computer has the correct time zone set shouldn't be too far-fetched - and you can always provide the user with a way to override that default.

Re: [PHP] Re: Date?

2002-06-09 Thread Gerard Samuel
Ill look into gmdate. I was going to get the timezone from the user to store in the database.. David Freeman wrote: > > Speaking of which. I was thinking about this this morning. > > Is there a part of the Unix timestamp that tells php what > > timezone to > > report. > >You could use the g

RE: [PHP] Re: Date?

2002-06-09 Thread David Freeman
> Speaking of which. I was thinking about this this morning. > Is there a part of the Unix timestamp that tells php what > timezone to > report. You could use the gmt-based date manipulation to do this. > Reason why I ask, is I would like to offset the unix > timestamp relative > to

Re: [PHP] Re: Date?

2002-06-09 Thread Miguel Cruz
On Sun, 9 Jun 2002, John Taylor-Johnston wrote: > > Sunday, June 09, 2002 > > But I would use: > > > > Don't know why, but someone told me once it had something to do with versions. date() just wants a plain ordinary string for the first argument (as the manual clearly says). I don't know wh

Re: [PHP] Re: Date?

2002-06-09 Thread Gerard Samuel
Speaking of which. I was thinking about this this morning. Is there a part of the Unix timestamp that tells php what timezone to report. Reason why I ask, is I would like to offset the unix timestamp relative to where a server is to a particular user. So lets say the user is in Europe, and the

RE: [PHP] Re: Date?

2002-06-09 Thread Bruce Karstedt
works just fine for me. Bruce Karstedt President Technology Consulting Associates, Ltd. Tel: 847-735-9488 Fax: 847-735-9474 -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 08, 2002 11:50 PM To: [EMAIL PROTECTED] Cc: Jeremy Bowen Subject: [P

Re: [PHP] Re: Date?

2002-06-08 Thread Jason Wong
On Sunday 09 June 2002 12:49, John Taylor-Johnston wrote: > > Sunday, June 09, 2002 > > But I would use: > > or simply: echo date ("l F d, Y"); -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Ap

RE: [PHP] Re: date format

2002-04-27 Thread John Holmes
No...Do it in your query. Use DATE_FORMAT in your query. ---John Holmes... > -Original Message- > From: George Nicolae [mailto:[EMAIL PROTECTED]] > Sent: Saturday, April 27, 2002 12:43 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: date format > > try > > $date="2002-04-27"; > > ech

Re: [PHP] Re: DATE Questions

2001-11-20 Thread Fred
gt; > > -Oorspronkelijk bericht- > Van: Fred [mailto:[EMAIL PROTECTED]] > Verzonden: dinsdag 20 november 2001 18:18 > Aan: [EMAIL PROTECTED] > Onderwerp: Re: [PHP] Re: DATE Questions > > > Alright. I was recently writting an attendance application for a school.

RE: [PHP] Re: DATE Questions

2001-11-20 Thread Oosten, Sjoerd van
___ -Oorspronkelijk bericht- Van: Fred [mailto:[EMAIL PROTECTED]] Verzonden: dinsdag 20 november 2001 18:18 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] Re: DATE Questions Alright. I was recently writting an attendance application for a school. I wanted to beable to display

Re: [PHP] Re: DATE Questions

2001-11-20 Thread Fred
Alright. I was recently writting an attendance application for a school. I wanted to beable to display attendance information from mysql in a calendar, but I did not want to have to write the calendar script from scratch. I must have looked at thirty or so calendar scripts before I found this o

RE: [PHP] Re: DATE Questions

2001-11-20 Thread Oosten, Sjoerd van
Of course i'm very interested! Greetings, Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 _

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Beeman
That worked. Thanks a lot... You rock -Beeman "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am > > using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a pri

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Rasmus Lerdorf
> Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am > using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a printf > statement but the date comes back as Dec 31 1969 7:00pm for all entries. > When the date was inserted I used now() in the insert statement. Yo

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Beeman
Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a printf statement but the date comes back as Dec 31 1969 7:00pm for all entries. When the date was inserted I used now() in the insert statement. "Rasmus Ler

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Rasmus Lerdorf
Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: > No it is definitely a DATETIME and the date and time are correct in the > database, but when I try to format and display them t

RE: [PHP] Re: Date/Time Query Help

2001-07-24 Thread Shrout, Ryan
lto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 3:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Date/Time Query Help On Tue, 24 Jul 2001 15:23:10 -0400, [EMAIL PROTECTED] (Ryan Shrout) wrote: >WHERE session.Date > DATE_SUB(NOW(), INTERVAL 1 HOUR) is equal to: > >WHERE 2001

Re: [PHP] Re: Date/Time Query Help

2001-07-24 Thread Bopolissimus Platypus
On Tue, 24 Jul 2001 15:23:10 -0400, [EMAIL PROTECTED] (Ryan Shrout) wrote: >WHERE session.Date > DATE_SUB(NOW(), INTERVAL 1 HOUR) is equal to: > >WHERE 2001-07-24 15:03:24 > SUBTRACTION( 2001-07-24 15:30:21, 00:01:00) = >WHERE 2001-07-24 15:03:24 > 2001-07-24 14:30:21 i just tested on my box (d

RE: [PHP] Re: Date/Time Query Help

2001-07-24 Thread Shrout, Ryan
Heh. :) So, does anyone know what I am doing wrong? Ryan Shrout -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 3:34 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Date/Time Query Help On Tue, 24 Jul 2001 15:23:10 -0400, [EMAIL

Re: [PHP] Re: Date/Time Query Help

2001-07-24 Thread Bopolissimus Platypus
On Tue, 24 Jul 2001 15:23:10 -0400, [EMAIL PROTECTED] (Ryan Shrout) wrote: >Think of it this way: > >WHERE session.Date > DATE_SUB(NOW(), INTERVAL 1 HOUR) is equal to: > >WHERE 2001-07-24 15:03:24 > SUBTRACTION( 2001-07-24 15:30:21, 00:01:00) = >WHERE 2001-07-24 15:03:24 > 2001-07-24 14:30:21 >

RE: [PHP] Re: Date/Time Query Help

2001-07-24 Thread Shrout, Ryan
Think of it this way: WHERE session.Date > DATE_SUB(NOW(), INTERVAL 1 HOUR) is equal to: WHERE 2001-07-24 15:03:24 > SUBTRACTION( 2001-07-24 15:30:21, 00:01:00) = WHERE 2001-07-24 15:03:24 > 2001-07-24 14:30:21 That seems right now, but it doesn't work Ryan -Original Message- From: [