You could also do it at the db level. obvisouly sending the string to the db
to get a timestamp back is not very effective performance wise, but if
you're going to insert it in a table of yours anyway you might as well
convert it there. Of if you've stored a heap of them as strings in the db
and you query on the lot for reporting.
DECLARE @mydate AS VARCHAR(50)
SET @mydate = 'Wed Oct 07 22:59:00 +0000 2009'
SELECT  CAST(SubString(@mydate, 4, 8) + RIGHT(@mydate, 4) +
SubString(@mydate, 11, 9) AS datetime)

Tof

On Thu, Oct 8, 2009 at 11:15 AM, Steve Onnis <st...@cfcentral.com.au> wrote:

>
> @mike
>
> That's why you just copy and paste :P
>
> -----Original Message-----
> From: Mike Kear [mailto:afpwebwo...@gmail.com]
> Sent: Thursday, 8 October 2009 11:13 AM
> To: cfaussie@googlegroups.com
> Subject: [cfaussie] Re: Convert a date to a proper date object
>
>
> I can't believe how timely this is!  I had JUST started staring at
> this date and begun thinking about how i was going to deal with this,
> when this thread popped up.
>
> @Paul i think your answer is tres elegant.    Thanks.
>
> @Steve your solution looks elegant too, but I just KNOW what would
> happen in my case - i'd miss off a close bracket or something.   I
> know it would happen because i have little invisible gremlins sitting
> on my shoulder that wait for me to code lines like that and fire a
> spark or something at my keyboard so it misses off keystrokes.
>
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Adobe Certified Advanced ColdFusion Developer
> AFP Webworks
> http://afpwebworks.com
> ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
>
>
> On Thu, Oct 8, 2009 at 10:54 AM, Steve Onnis <st...@cfcentral.com.au>
> wrote:
> > Looks like it is formatted like a javascript date
> >
> > also notice there is no time zone info though....bit of a pain that is
> >
> > thanks for the code snipped though.
> >
> > i actually decided to do it this way
> >
> > tweetDate = ParseDateTime(listFirst(ListSetAt(tweetDate, 1,
> > listLast(tweetDate, " "), " "), "+"));
> >
> > basically turn
> >
> > Fri Sept 19 16:30:00 +0000 2009
> >
> > into
> >
> > 2009 Fri Sept 19 16:30:00
> >
> > and then parse it with ParseDate()
> >
> >
> > From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On
> Behalf
> > Of Steve Onnis
> > Sent: Wednesday, October 07, 2009 7:32 PM
> > To: cfaussie@googlegroups.com
> > Subject: [cfaussie] Re: Convert a date to a proper date object
> >
> >
> >
> > yes twitter (dam twits!)
> >
> >
> >
> > why is the date like that anyway?
> >
> >
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to