php-general Digest 22 Jun 2011 14:15:31 - Issue 7370
Topics (messages 313635 through 313635):
newbie date time question
313635 by: David Nicholls
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest,
I'm trying to convert a date and time string using strtotime()
The date and time strings are the first entry in each line in a csv file
in the form:
22/06/2011 9:47:20 PM, data1, data2,...
I've been trying to use the following approach, without success:
function read_data($filename)
{
On 23/06/11 12:23 AM, Adam Balogh wrote:
hi,
you have a PM(/AM) in your date ($d[0]), so put an A (Uppercase Ante
meridiem and Post meridiem) format char to your $format variable.
b3ha
Thanks, Adam. Tried that and it's now throwing an error:
Catchable fatal error: Object of class DateTime
Perhaps someone can tell me the secret to getting problem-free access to the
php newsgroups using OE. I have two other newsgroup servers configured in
OE which do not give me any difficulties at all. My setup for news.php.net
however gives me nothing but problems. Inability to connect to
On 23/06/11 12:30 AM, Richard Quadling wrote:
On 22 June 2011 15:05, David Nichollsd...@dcnicholls.com wrote:
I'm trying to convert a date and time string using strtotime()
The date and time strings are the first entry in each line in a csv file in
the form:
22/06/2011 9:47:20 PM, data1,
$dt is an object as the error says, so you cant echo it, becouse its not a
string (it can be with __toString magic method, or use print_r/var_dump to
output your object). Try the format (
http://www.php.net/manual/en/datetime.format.php) method on your $dt object.
On Wed, Jun 22, 2011 at 4:41 PM,
On 22 June 2011 15:05, David Nicholls d...@dcnicholls.com wrote:
I'm trying to convert a date and time string using strtotime()
The date and time strings are the first entry in each line in a csv file in
the form:
22/06/2011 9:47:20 PM, data1, data2,...
I've been trying to use the
OK, looks like I have fixed problem, using:
$format = 'd/m/Y g:i:s A';
$dt = date_create_from_format($format, $d[0]);
$dt2 = date('r', $dt-getTimestamp());
$data[] = array(strtotime($dt2), $d[1]);
Not elegant but it gives me the date/time value.
Thanks, Adam and
On Wednesday, 22 June 2011 at 15:59, David Nicholls wrote:
OK, looks like I have fixed problem, using:
$format = 'd/m/Y g:i:s A';
$dt = date_create_from_format($format, $d[0]);
$dt2 = date('r', $dt-getTimestamp());
$data[] = array(strtotime($dt2), $d[1]);
Not elegant but it gives
On 06/22/2011 09:45 AM, Jim Giner wrote:
Perhaps someone can tell me the secret to getting problem-free access to the
php newsgroups using OE. I have two other newsgroup servers configured in
OE which do not give me any difficulties at all. My setup for news.php.net
however gives me
On 06/22/2011 09:05 AM, David Nicholls wrote:
I'm trying to convert a date and time string using strtotime()
The date and time strings are the first entry in each line in a csv file
in the form:
22/06/2011 9:47:20 PM, data1, data2,...
I've been trying to use the following approach,
Well - it's a secret until one asks I guess. Thanks Shawn for the info.
Since you say it's been happening for years, I guess there's no hope for
resolution.
Can you or someone else recommend a newsgroup client that functions better
with this group?
BTw - this is my second attempt to respond
On 22 Jun 2011 at 19:44, Ethan Rosenberg eth...@earthlink.net wrote:
I have a PHP program which will generate a chess board with a form in
the program. I wish to fill the form by clicking one of the
squares in the chess board. I am trying to use jQuery and Aja to do
this. The Ajax call
All I can suggest is either compile from source or find a different mac
binary. I don't often deal with macs, much less try to use them as servers,
so that's the best I can offer. Good luck.
On Jun 20, 2011 1:53 PM, Bruno Coelho brunocsncoe...@gmail.com wrote:
On 6/22/2011 12:43 PM, Tim Streater wrote:
On 22 Jun 2011 at 19:44, Ethan Rosenberg eth...@earthlink.net wrote:
I have a PHP program which will generate a chess board with a form in
the program. I wish to fill the form by clicking one of the
squares in the chess board. I am trying to use
On 22 Jun 2011 at 20:56, Jim Lucas li...@cmsws.com wrote:
On 22/6/2011 12:43 PM, Tim Streater wrote:
On 22 Jun 2011 at 19:44, Ethan Rosenberg eth...@earthlink.net wrote:
I have a PHP program which will generate a chess board with a form in
the program. I wish to fill the form by clicking
On 22 Jun 2011 at 21:56, Ethan Rosenberg eth...@earthlink.net wrote:
At 04:30 PM 6/22/2011, you wrote:
On 22 Jun 2011 at 20:56, Jim Lucas li...@cmsws.com wrote:
So the OP is using the form's action to reload the page, and
seemingly making an ajax call under some circumstance that will also
Hello,
is there a chance with php to use rewriting?
Like Example:
mysite.com/theme.php?id=1 to theme.php theme2.php etc.
I have ask on the nginx list, but there they say i should use the power
language php.
When i search in google for Examples or Tutorials i only found mod_rewriting.
try
RewriteEngine on
RewriteRule ^theme([0-9]+).php$ /index.php?theme=$1 [L]
On Wed, Jun 22, 2011 at 11:22 PM, Silvio Siefke li...@silvio-siefke.dewrote:
Hello,
is there a chance with php to use rewriting?
Like Example:
mysite.com/theme.php?id=1 to theme.php theme2.php etc.
I
On Wed, Jun 22, 2011 at 17:32, Fatih P. fatihpirist...@gmail.com wrote:
try
RewriteEngine on
RewriteRule ^theme([0-9]+).php$ /index.php?theme=$1 [L]
That's neither nginx nor PHP, so it's not really relevant to the
OP's questions.
--
/Daniel P. Brown
Network Infrastructure Manager
On Wed, Jun 22, 2011 at 17:22, Silvio Siefke li...@silvio-siefke.de wrote:
Hello,
is there a chance with php to use rewriting?
Like Example:
mysite.com/theme.php?id=1 to theme.php theme2.php etc.
I have ask on the nginx list, but there they say i should use the power
language php.
When
I have a bunch of records in a DB that look like
id | parent_id
--
1 | 4
2 | 4
3 | 2
4 | 0
5 | 2
6 | 1
7 | 3
8 | 7
9 | 7
I want to build a big has that looks like:
4 - 1 - 6
- 2 - 3 - 7 - 9
- 5 - 8
I'm like 90% of the way there, but I can't get my recursive
On 23/06/2011, at 9:53 AM, Scott Baker wrote:
I have a bunch of records in a DB that look like
id | parent_id
--
1 | 4
2 | 4
3 | 2
4 | 0
5 | 2
6 | 1
7 | 3
8 | 7
9 | 7
I want to build a big has that looks like:
4 - 1 - 6
- 2 - 3 - 7 - 9
- 5 -
On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
Has someone a Link with Tutorials or other Information?
Not entirely sure what you're asking here, or how you (or the
nginx folks) expect it to relate to PHP. Do you mean that you want to
use PHP to have theme2.php act as if it
On Wed, 22 Jun 2011 23:32:10 +0200 Fatih P. wrote:
try
RewriteEngine on
RewriteRule ^theme([0-9]+).php$ /index.php?theme=$1 [L]
That is rule for Apache i think. I have nginx, and there i have try much
rules but nothing want work. And on the list from nginx the maintainer write,
i should use
On 23/06/2011, at 9:57 AM, Simon J Welsh wrote:
On 23/06/2011, at 9:53 AM, Scott Baker wrote:
I have a bunch of records in a DB that look like
id | parent_id
--
1 | 4
2 | 4
3 | 2
4 | 0
5 | 2
6 | 1
7 | 3
8 | 7
9 | 7
I want to build a big has that looks
On Wednesday, June 22, 2011, Daniel Brown wrote:
RewriteEngine on RewriteRule ^theme([0-9]+).php$
/index.php?theme=$1 [L]
That's neither nginx nor PHP, so it's not really relevant to the
OP's questions.
I guess that the answer should be that you can rewrite outside of PHP
and then make
On 06/22/2011 03:06 PM, Simon J Welsh wrote:
On further inspection, that's not the problem at all. The problem's around
assign_children($pid,$list,$new);
The previous line you defined $new with $new = $leaf[$pid], *copying* that
node into $new. Thus the assign_children() call updates $new,
On 23/06/2011, at 10:14 AM, Scott Baker wrote:
On 06/22/2011 03:06 PM, Simon J Welsh wrote:
On further inspection, that's not the problem at all. The problem's around
assign_children($pid,$list,$new);
The previous line you defined $new with $new = $leaf[$pid], *copying* that
node into
On 06/22/2011 03:17 PM, Simon J Welsh wrote:
You still need to pass the value by reference to assign_children(), so:
$new = $leaf[$pid];
assign_children($pid,$list,$new);
Aha... that was it! Thanks!
--
Scott Baker - Canby Telcom
System Administrator - RHCE - 503.266.8253
--
PHP General
On 06/22/2011 03:17 PM, Simon J Welsh wrote:
You still need to pass the value by reference to assign_children(), so:
$new = $leaf[$pid];
assign_children($pid,$list,$new);
One last thing I fixed was that PHP was complaining that run-time pass
by reference was deprecated. I changed
Hi Gang!
i have 2 assoc arrays from 2 querys,
first one is page categorys it consists of:
id
name
second is pages
name
cat_id
now, i am using smarty, so i pass arrays into the view. this i would like to
pass to the view and display within a html select
I've reported the issue Bugzilla two times, and others have also.
On 6/22/2011 11:27 AM, Shawn McKenzie wrote:
On 06/22/2011 09:45 AM, Jim Giner wrote:
Perhaps someone can tell me the secret to getting problem-free access to the
php newsgroups using OE. I have two other newsgroup servers
On Wed, Jun 22, 2011 at 18:43, Adam Preece a...@blueyonder.co.uk wrote:
Hi Gang!
i have 2 assoc arrays from 2 querys,
first one is page categorys it consists of:
id
name
second is pages
name
cat_id
now, i am using smarty, so i pass arrays into the view.
On 23/06/11 1:35 AM, Shawn McKenzie wrote:
On 06/22/2011 09:05 AM, David Nicholls wrote:
I'm trying to convert a date and time string using strtotime()
The date and time strings are the first entry in each line in a csv file
in the form:
22/06/2011 9:47:20 PM, data1, data2,...
I've been
On 23/06/11 1:02 AM, Stuart Dallas wrote:
On Wednesday, 22 June 2011 at 15:59, David Nicholls wrote:
OK, looks like I have fixed problem, using:
$format = 'd/m/Y g:i:s A';
$dt = date_create_from_format($format, $d[0]);
$dt2 = date('r', $dt-getTimestamp());
$data[] =
On 06/22/2011 06:54 PM, David Nicholls wrote:
I'm late to the party, but strtotime works great, though you need to
give it what it expects:
$ts = strtotime(str_replace('/', '-', $date));
Thanks, Shawn, that's a bit more elegant! I'll give it a go. I didn't
know how to do the str_relace
On 6/22/2011 3:43 PM, Adam Preece wrote:
Hi Gang!
i have 2 assoc arrays from 2 querys,
first one is page categorys it consists of:
id
name
second is pages
name
cat_id
now, i am using smarty, so i pass arrays into the view. this i would like to
pass to
On 23/06/11 10:04 AM, Shawn McKenzie wrote:
On 06/22/2011 06:54 PM, David Nicholls wrote:
I'm late to the party, but strtotime works great, though you need to
give it what it expects:
$ts = strtotime(str_replace('/', '-', $date));
Thanks, Shawn, that's a bit more elegant! I'll give it a
39 matches
Mail list logo