I have a problem when I try to insert a date (Now()) in a timestamp declared BigQuery table field.
I code in ColdFusion language. In this language, the function Now() returns a datetime of this format: {ts '2014-05-05 15:32:06'}
This is my BigQuery table schema: Name:string,Date:Timestamp
This is my code trying to insert a row:
<cfset row.set("Name","Alex")>
<cfset row.set("Date", now())>
Since the schema in Google BigQuery API does not support date types other than timestamp what should I do to convert the date given by the function now() (in ColdFusion) to be able to insert my row?
Thank you all for your answers, if we have to pass a string variable as a second argument for the method set we can also write:
<cfset row.set('Date',mid("#now()#",6,19))>
to retreive a string of (yyyy-mm-dd HH:MM:SS)
date/timeFormat()as suggested below. Also, nothing to do with your question, but the quotes and#signs aroundnow()are not needed. - Leigh