[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Paul Kukiel
Hey Steve,

 

Let me guess Twitter's API?

 

I solved it like this:  http://pastebin.com/m6cfd7da9

 

Paul.

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of Steve Onnis
Sent: Wednesday, October 07, 2009 7:14 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Convert a date to a proper date object

 

How do i convert Wed Oct 07 22:59:00 + 2009 to a date in can use in CF
?

 

Steve



 


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



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Steve Onnis
yes twitter (dam twits!)
 
why is the date like that anyway?

  _  

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Thursday, 8 October 2009 10:24 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Convert a date to a proper date object



Hey Steve,

 

Let me guess Twitter's API?

 

I solved it like this:  http://pastebin.com/m6cfd7da9

 

Paul.

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of Steve Onnis
Sent: Wednesday, October 07, 2009 7:14 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Convert a date to a proper date object

 

How do i convert Wed Oct 07 22:59:00 + 2009 to a date in can use in CF
?

 

Steve





 





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



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Paul Kukiel
I don't know it's weird.  I tried heaps of simpler ways to force this to
work but in the end that solution worked pretty well.

 

I guess it's a time offset or something.  Usually one of our ( ColdFusion )
date functions would work but not this time ( unless I missed something ? )

 

Paul.

 

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?

 

  _  

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Thursday, 8 October 2009 10:24 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Convert a date to a proper date object

Hey Steve,

 

Let me guess Twitter's API?

 

I solved it like this:  http://pastebin.com/m6cfd7da9

 

Paul.

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of Steve Onnis
Sent: Wednesday, October 07, 2009 7:14 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Convert a date to a proper date object

 

How do i convert Wed Oct 07 22:59:00 + 2009 to a date in can use in CF
?

 

Steve

 

 

BR


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



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Steve Onnis
Looks like it is formatted like a javascript date
 
also notice there is no time zone info thoughbit 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 + 2009
 
into 
 
2009 Fri Sept 19 16:30:00
 
and then parse it with ParseDate()
 
 
  _  

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Thursday, 8 October 2009 10:36 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Convert a date to a proper date object



I don't know it's weird.  I tried heaps of simpler ways to force this to
work but in the end that solution worked pretty well.

 

I guess it's a time offset or something.  Usually one of our ( ColdFusion )
date functions would work but not this time ( unless I missed something ? )

 

Paul.

 

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?

 

  _  

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Thursday, 8 October 2009 10:24 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Convert a date to a proper date object

Hey Steve,

 

Let me guess Twitter's API?

 

I solved it like this:  http://pastebin.com/m6cfd7da9

 

Paul.

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of Steve Onnis
Sent: Wednesday, October 07, 2009 7:14 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Convert a date to a proper date object

 

How do i convert Wed Oct 07 22:59:00 + 2009 to a date in can use in CF
?

 

Steve

 

 

BR






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



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Mike Kear

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 thoughbit 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 + 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
-~--~~~~--~~--~--~---



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread Steve Onnis

@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 thoughbit 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 + 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
-~--~~~~--~~--~--~---



[cfaussie] Re: Convert a date to a proper date object

2009-10-07 Thread christophe albrech
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 + 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 thoughbit 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 + 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
-~--~~~~--~~--~--~---