Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
At my work, we even have custom ones. When people whinge, we say they scrunch because frowning makes their face look like a scrunchie ( http://www.fancypocket.sg/images/P/703998P.jpg). There's also this one girl who scrunches all the time and has massive... well, you know. We call her Whine-rack. Tof On Thu, Feb 16, 2012 at 2:49 PM, Andrew Myers am2...@gmail.com wrote: I use them interchangeably Charlie. It even together. My kids are so good at it they 'whinge and whine' all day! Sent from my mobile On 16/02/2012, at 2:21 PM, charlie arehart charlie_li...@carehart.org wrote: Yeah, leave such whining to me. :-) Thinking of my note earlier today. Groan. Sorry 'bout that, folks. Actually, don't you guys say whinging anyway? :-) /charlie -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Andrew Myers Sent: Wednesday, February 15, 2012 9:02 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch? I think I'll just do what i was initially trying to do and write a function that creates a Java date and be done with it. In fact if I'd have stopped whining and just written the damn thing id be on to the next problem by now :) On 16/02/2012, at 12:43 PM, Steve Onnis st...@cfcentral.com.au wrote: CreateDate() ? -- 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. -- 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. -- 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.
RE: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
I wasn’t born until 1975. Maybe they should change it to start from then :) -Original Message- From: Andrew [mailto:am2...@gmail.com] Sent: Thursday, 16 February 2012 12:33 PM To: cfaussie Subject: [cfaussie] Re: Convert cf date to milliseconds since the epoch? 1/1/1970 is the Unix epoch date - it's pretty widely used. Obviously nothing interesting ever happened before then...? ;-) But seriously - I've always wondered how dates prior to that represented? As negative numbers? On Feb 16, 12:27 pm, Steve Onnis st...@cfcentral.com.au wrote: Why 1970? That seems a little odd. You could do DateAdd(y, 1970, yourdate) ? -Original Message- From: Andrew [mailto:am2...@gmail.com] Sent: Thursday, 16 February 2012 12:25 PM To: cfaussie Subject: [cfaussie] Convert cf date to milliseconds since the epoch? This is sort of related to my graphing question from the other day. I'm using Flot and the times need to be expressed as milliseconds since January 1, 1970 00:00:00. In Java you can call .getTime() on a function to do this. Does CF provide a simple way to either: * Convert a cf date to time in millis?; OR * Convert a cf date to a java date? I could create a new Java Calendar object and then set the various date parts, but before I write a wrapper function to do it that way I figured I'd see if I was missing something obvious? Andrew. -- 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 athttp://groups.google.com/group/cfaussie?hl=en. === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260)http://www.pctools.com/ === === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260)http://www.pctools.com/ === -- 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. === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === -- 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.
Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
I think I'll just do what i was initially trying to do and write a function that creates a Java date and be done with it. In fact if I'd have stopped whining and just written the damn thing id be on to the next problem by now :) On 16/02/2012, at 12:43 PM, Steve Onnis st...@cfcentral.com.au wrote: CreateDate() ? -Original Message- From: Andrew [mailto:am2...@gmail.com] Sent: Thursday, 16 February 2012 12:40 PM To: cfaussie Subject: [cfaussie] Re: Convert cf date to milliseconds since the epoch? Hmm not that simple. The dates are coming from a query, and .getTime() appears not to be valid, for example: cfquery name=q datasource=ds_web_content select sysdate from dual /cfquery cfdump var=#q.sysdate# cfoutput#q.sysdate.getTime()#/cfoutput Error: The getTime method was not found. Either there are no methods with the specified method name and argument types or the getTime method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity. This doesn't work either: cfset javaDate = JavaCast(java.util.Date, q.sysdate) Error: JavaCast type java.util.Date must be one of the following types: byte, char, short, int, long, float, double, boolean, string, bigdecimal, their corresponding array representation (eg : int[]), or null. Mongrel! On Feb 16, 12:28 pm, Andrew am2...@gmail.com wrote: Umm, okay this works: cfset dateNow = now() cfoutput#now.getTime()#/cfoutput Always missing the obvious! On Feb 16, 12:24 pm, Andrew am2...@gmail.com wrote: This is sort of related to my graphing question from the other day. I'm using Flot and the times need to be expressed as milliseconds since January 1, 1970 00:00:00. In Java you can call .getTime() on a function to do this. Does CF provide a simple way to either: * Convert a cf date to time in millis?; OR * Convert a cf date to a java date? I could create a new Java Calendar object and then set the various date parts, but before I write a wrapper function to do it that way I figured I'd see if I was missing something obvious? Andrew. -- 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. === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === -- 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. -- 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.
Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
I think you were on the right track with .getTime() I tried your SYSDATE example and was able to get the desired result with; lsparsedatetime(qry.sysdate).getTime() I also tried casting the date in the SQL, but the above works (for SYSDATE at least) On 16/02/2012, at 13:02, Andrew Myers am2...@gmail.com wrote: I think I'll just do what i was initially trying to do and write a function that creates a Java date and be done with it. In fact if I'd have stopped whining and just written the damn thing id be on to the next problem by now :) On 16/02/2012, at 12:43 PM, Steve Onnis st...@cfcentral.com.au wrote: CreateDate() ? -Original Message- From: Andrew [mailto:am2...@gmail.com] Sent: Thursday, 16 February 2012 12:40 PM To: cfaussie Subject: [cfaussie] Re: Convert cf date to milliseconds since the epoch? Hmm not that simple. The dates are coming from a query, and .getTime() appears not to be valid, for example: cfquery name=q datasource=ds_web_content select sysdate from dual /cfquery cfdump var=#q.sysdate# cfoutput#q.sysdate.getTime()#/cfoutput Error: The getTime method was not found. Either there are no methods with the specified method name and argument types or the getTime method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity. This doesn't work either: cfset javaDate = JavaCast(java.util.Date, q.sysdate) Error: JavaCast type java.util.Date must be one of the following types: byte, char, short, int, long, float, double, boolean, string, bigdecimal, their corresponding array representation (eg : int[]), or null. Mongrel! On Feb 16, 12:28 pm, Andrew am2...@gmail.com wrote: Umm, okay this works: cfset dateNow = now() cfoutput#now.getTime()#/cfoutput Always missing the obvious! On Feb 16, 12:24 pm, Andrew am2...@gmail.com wrote: This is sort of related to my graphing question from the other day. I'm using Flot and the times need to be expressed as milliseconds since January 1, 1970 00:00:00. In Java you can call .getTime() on a function to do this. Does CF provide a simple way to either: * Convert a cf date to time in millis?; OR * Convert a cf date to a java date? I could create a new Java Calendar object and then set the various date parts, but before I write a wrapper function to do it that way I figured I'd see if I was missing something obvious? Andrew. -- 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. === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === === Email scanned by PC Tools - No viruses or spyware found. (Email Guard: 9.0.0.909, Virus/Spyware Database: 6.19260) http://www.pctools.com/ === -- 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. -- 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. -- 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.
RE: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
Yeah, leave such whining to me. :-) Thinking of my note earlier today. Groan. Sorry 'bout that, folks. Actually, don't you guys say whinging anyway? :-) /charlie -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Andrew Myers Sent: Wednesday, February 15, 2012 9:02 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch? I think I'll just do what i was initially trying to do and write a function that creates a Java date and be done with it. In fact if I'd have stopped whining and just written the damn thing id be on to the next problem by now :) On 16/02/2012, at 12:43 PM, Steve Onnis st...@cfcentral.com.au wrote: CreateDate() ? -- 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.
Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch?
I use them interchangeably Charlie. It even together. My kids are so good at it they 'whinge and whine' all day! Sent from my mobile On 16/02/2012, at 2:21 PM, charlie arehart charlie_li...@carehart.org wrote: Yeah, leave such whining to me. :-) Thinking of my note earlier today. Groan. Sorry 'bout that, folks. Actually, don't you guys say whinging anyway? :-) /charlie -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Andrew Myers Sent: Wednesday, February 15, 2012 9:02 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Re: Convert cf date to milliseconds since the epoch? I think I'll just do what i was initially trying to do and write a function that creates a Java date and be done with it. In fact if I'd have stopped whining and just written the damn thing id be on to the next problem by now :) On 16/02/2012, at 12:43 PM, Steve Onnis st...@cfcentral.com.au wrote: CreateDate() ? -- 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. -- 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.