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
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
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
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
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
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
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
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
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
> 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
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
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.
>> 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(
-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
>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()
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
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
> 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
> 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...
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
> 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
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.
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
> 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
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
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
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
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
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
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.
___
-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
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
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
_
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
> 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
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
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
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
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
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
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
>
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: [
57 matches
Mail list logo