Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting one date format to another

1 view
Skip to first unread message

Jason Carlton

unread,
Dec 19, 2009, 6:04:59 AM12/19/09
to
I have 2 date formats currently being used in RSS feeds that I'm
importing, and I want to convert both to a format that is used
locally. The RSS formats are like:

2009-12-18T11:10:11.122-05:00

and

Fri, 18 Dec 2009 11:10:12 -0500

I want to convert both to YmdHis format; eg, 20091218111012

Other than manually breaking them down, is there a simple way to do
this?

TIA,

Jason

Jerry Stuckle

unread,
Dec 19, 2009, 6:58:50 AM12/19/09
to

http://www.php.net/manual/en/function.strtotime.php

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Luuk

unread,
Dec 19, 2009, 7:01:31 AM12/19/09
to
Jason Carlton schreef:

http://nl.php.net/manual/en/function.date-parse-from-format.php

or

http://nl.php.net/manual/en/function.date-parse.php

look at the examples, and pick the one you like most ;-)

--
Luuk

Scott Johnson

unread,
Dec 19, 2009, 9:01:07 AM12/19/09
to

OK Hands down I like that date-parse-from-format function, putting that
one in my notebook.

Thanks
Scotty

Luuk

unread,
Dec 19, 2009, 10:06:20 AM12/19/09
to
Op 19-12-2009 15:01, Scott Johnson schreef:

you better put php.net in there, and start searching there if you need
something that you dont know how to do... ;-)

--
Luuk

Scott Johnson

unread,
Dec 19, 2009, 6:10:11 PM12/19/09
to

HUH???

What the heck is wrong with people around here. You give them a
complement and all they can do is criticize. Maybe you need to get out
of your Mommies basement and realize in the real world most people have
to work for a living and don't have the time to read the manual from
page to page, but realize when someone brings a good function to light
that may be needed in the 'future'.

Scotty


Jason Carlton

unread,
Dec 19, 2009, 6:57:07 PM12/19/09
to


Thanks for the tips, all. I had looked at strtotime() before, but
didn't understand how to use it to do this.

Scotty, I couldn't agree more, and I think it's one of the main
reasons for the demise of newsgroups. More and more people are using
moderated message boards now, because people are generally mean and
rude in NGs. IMO, we're witnessing the end of an era.

This NG isn't as bad as some, though; at least people help. I can't
stand comp.lang.perl.misc anymore.

Curtis Dyer

unread,
Dec 20, 2009, 8:03:47 AM12/20/09
to
On 19 Dec 2009, Scott Johnson <scott.e...@att.net> wrote:

> Luuk wrote:
>> Op 19-12-2009 15:01, Scott Johnson schreef:
>>> Luuk wrote:
>>>> Jason Carlton schreef:

<snip>

>>> OK Hands down I like that date-parse-from-format function,
>>> putting that one in my notebook.
>>>
>>> Thanks
>>> Scotty
>>
>> you better put php.net in there, and start searching there if
>> you need something that you dont know how to do... ;-)
>>
>
> HUH???
>
> What the heck is wrong with people around here. You give them a
> complement and all they can do is criticize.

Maybe just me, but it didn't seem like Luuk was intending to
criticize.

> Maybe you need to
> get out of your Mommies basement and realize in the real world
> most people have to work for a living and don't have the time to
> read the manual from page to page, but realize when someone
> brings a good function to light that may be needed in the
> 'future'.

Even if you did have a lot of free time, trying to memorize the
manual, page by page, would be poor use of your time. As long as
you know how to find the information you need, when you need it,
you're fine.

Whenever I look up something in the PHP docs, I sometimes take a
few minutes to glance a few of the related functions listed on the
left side of the page. I don't memorize them, but knowing they're
there when the need arises can be helpful. Even though I don't
live in my mom's basement (if she had one), I think I do okay.
:-)

--
Curtis Dyer
<? $x='<? $x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>

Scott Johnson

unread,
Dec 20, 2009, 9:19:50 AM12/20/09
to

Spot on. I also learned not to post a reply when you have just been
arguing with the wife.
Luuk my apologies for being rude, maybe you had me confused with the OP,
I don't know. I gotta learn to leave and come back before posting a
retort.

Peace Out
Scotty

Luuk

unread,
Dec 21, 2009, 10:06:32 AM12/21/09
to
Op 20-12-2009 0:10, Scott Johnson schreef:

lol, my reply was ment as an advice too.... ;-)

But sometimes its hard to write te proper English words, and someone
like /me who is not a native English speaker might do it wrong ?

--
Luuk

matt

unread,
Dec 21, 2009, 1:45:00 PM12/21/09
to
On Dec 19, 6:10 pm, Scott Johnson <scott.e.john...@att.net> wrote:

> What the heck is wrong with people around here.  You give them a
> complement and all they can do is criticize.  Maybe you need to get out
> of your Mommies basement and realize in the real world most people have
> to work for a living and don't have the time to read the manual from
> page to page, but realize when someone brings a good function to light
> that may be needed in the 'future'.

Hmm...I work for a living, and I find it way faster to search php.net
than post to Usenet and wait for a response...

Scott Johnson

unread,
Dec 21, 2009, 6:16:44 PM12/21/09
to

I agree, but if you are replying to me, what is your point?

I use php.net pretty much most of the time unless I have a technique issue.

Scotty

matt

unread,
Dec 22, 2009, 9:18:26 AM12/22/09
to
On Dec 21, 6:16 pm, Scott Johnson <scott.e.john...@att.net> wrote:
> matt wrote:
> > On Dec 19, 6:10 pm, Scott Johnson <scott.e.john...@att.net> wrote:
>
> >> What the heck is wrong with people around here.  You give them a
> >> complement and all they can do is criticize.  Maybe you need to get out
> >> of your Mommies basement and realize in the real world most people have
> >> to work for a living and don't have the time to read the manual from
> >> page to page, but realize when someone brings a good function to light
> >> that may be needed in the 'future'.
>
> > Hmm...I work for a living, and I find it way faster to search php.net
> > than post to Usenet and wait for a response...
>
> I agree, but if you are replying to me, what is your point?

Scotty, here's an abbreviated path of conversation to which I was
referring:

<snippet>
Scotty wrote:

> Luuk wrote:
>
> > you better put php.net in there, and start searching there if you need
> > something that you dont know how to do... ;-)
>

> Maybe you need to get out of your Mommies basement and realize in
> the real world most people have to work for a living and don't
> have the time to read the manual from page to page

</snippet>

I interpreted that as you criticizing php.net as a useful resource for
the active/employed programmer. Sorry if I misunderstood your
intentions.

> I use php.net pretty much most of the time unless I have a technique issue.

Actually, I find that the user comments on many of the manual pages
are chock full of good techniques as well.

Matt

Scott Johnson

unread,
Dec 22, 2009, 7:22:40 PM12/22/09
to

I just wanted to make sure I understood what you where saying. So often
there are many different languages and cultures here and that is very
hard to interpret text in the proper context. I did not read anything
that needs apologize over.....unless you know something I don't..:)

As for the manual....
Oh yeah, if you stop at the actual manual pages, you do end up missing
some valuable info, plus some extra ways to use the functions not shown
in the 'official' text.

Keep on chugging alone...

Scotty

matt

unread,
Dec 23, 2009, 9:11:27 AM12/23/09
to
On Dec 22, 7:22 pm, Scott Johnson <scott.e.john...@att.net> wrote:

> Keep on chugging alone...

I hope you meant "along"...big difference :D

Scott Johnson

unread,
Dec 23, 2009, 6:44:57 PM12/23/09
to

WOOPS...ya that could of been takin very badly...

Scotty

0 new messages