Hi,
I took this line (which works) and am trying to put a fixed dummy date into it:
def eventPostTime = URLEncoder.encode((new Date()).format( 'MM/dd/yyyy HH:mm:ss', location.timeZone ))
I have tried countless variations, like:
def eventPostTime = URLEncoder.encode((new Date()).format( 'MM/dd/yyyy HH:mm:ss', '02/02/2002 02:02:02' ))
or
def eventPostTime = URLEncoder.encode((new Date( '02/02/2002 02:02:02' )).format( 'MM/dd/yyyy HH:mm:ss'))
or
def eventPostTime = URLEncoder.encode((new Date()).format( 'MM/dd/yyyy HH:mm:ss', '2002', '02', '02', '02', '02', '02' ))
.
Any dummy date at all will do.
Most every time I get an error like
error groovy.lang.MissingMethodException: No signature of method: java.util.Date.format() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) values: [MM/dd/yyyy HH:mm:ss, 2002, 02, 02, 00, 00, ...] @ line 331
Google can’t help because web explanations are vague with no examples, or it’s for javascript (not groovy), or it gives an error when I do exactly what it says (but it’s never clear if the example was the right flavor of javascript/groovy/what the hell ever).
I can’t believe I lost three hours of my life (going on 4 or 5) going around in circles on something so incredibly simple as putting a fixed date into one line of code. Groovy is such a b to learn, not the least because all the very-close-but-different languages really confuse everything.
Anyway.
Thanks if you can help!