ContributionsMost RecentMost LikesSolutionsRe: Can't create a non-UTC Date object to call .getTime() on as was gone over above, this doesn’t work Re: Can't create a non-UTC Date object to call .getTime() on So that is the first thing I tried, but it gives me a UTC DateTime object at 00:00:00 for the Date, and calls getTime() on it. You cannot call getTime() without the Date.parse() which turns it into a UTC timezone because toLocalDateString() and toLocalDateTimeString() both return a datetime string WITHOUT the timezone or offset. Even though the snaplogic documentation says you can provide a ‘x’ or a ‘z’ in the ‘format’ parameter the result doesn’t contain any timestamp information for Date.parse() to understand. I even tried appending the timezone information to what is passed into the Date.parse() with no luck. This will result in a UTC Y-m-d 00:00:00 timestamp. I need a America/Los_Angeles Y-m-d 00:00:00 timestamp. If I used the above, I will be off by whatever the offset is in the America/Los_Angeles timezone. Re: Can't create a non-UTC Date object to call .getTime() on That will get you a date-time string not a timestamp. How do you turn that into a timestamp? Re: Can't create a non-UTC Date object to call .getTime() on Unfortunately that isn’t how timezones work though. I would have to calculate the offset based on the America/Las_Angeles timezone at the given DateTime. Specific example, I need to generate the timestamp for the following date to pass into an API: “2019-09-21 00:00:00” but I need to write a bunch of logic to determine whether that time in the America\Las_Angeles timezone would be PDT or PST (as daylight savings time may or may not be in effect, which effects the offset). This should be simple if I could create the Date object in a timezone other than UTC but I can’t find a way to do so. The API I haver to hit is set to PST in it’s handling of the passed in timestamp. It only returns data from the provided timestamp until end of that day. If I pass in a UTC based timestamp then the results will be way off, and I am needing a full day of data which means passing in a PST based timestamp for the 00:00:00 time of a given date (which I can’t generate in SnapLogic). Re: Can't create a non-UTC Date object to call .getTime() on That will give you a date-time string but not a timestamp. Try to create a timestamp from that and that is my issue. Re: Can't create a non-UTC Date object to call .getTime() on I don’t think you read the issue fully. I DON’T want UTC based timestamp and you cannot call getTime() on LocalDateTime or LocalDate which is used to create a non-UTC Date object. I cannot find a way to get the timestamp for a non-UTC Date. It doesn’t matter I guess as I altered the called service to accommodate things. Can't create a non-UTC Date object to call .getTime() on I need to pull data from an API that needs a timestamp as a parameter. This API retrieves data from a system (not in my control) that is based in the America/Las_Angeles timezone. I have tried for hours to find a way to generate a non-UTC Date object (LocalDateTime object doesn’t contain a getTime() method) so that I can call .getTime() but I seem to only be able to get a string value of the converted UTC Date into my desired timezone. I tried to find a way to use the getTimezoneOffset() function, but I need a non-UTC Date object in order to get the valid offset from so I’m back to square one. Can anyone provide an example of creating a Date object in Snap with a non-UTC timezone that I can call getTime()? (I just need to generate a timestamp based on a PST Date with a 00:00:00 time) I tried creating the converted string (which I can’t get to include the timezone, because even though the docs point to SimpleDateFormat (Java Platform SE 7 ) as a reference I cannot get the value output for any of the time zone components) and appending ’ PST’ but it still created a UTC Date. I have spent way too long trying to do something so simple that is a couple lines of code in almost any language and needs some guidance lol. Re: Query Issue - Generic JDBC - Execute I have all of my pipelines set to use a generic error pipeline that feeds the data into an s3 bucket. Which is funny because that generic error pipeline is working fine and logging currently, but didn’t log anything for this error. Re: Query Issue - Generic JDBC - Execute I found that there was an invalid date-time value set on one record which was the issue. This does make me curious though, why would the whole process stop because of one row instead of either casting it as a string or just skipping only that one record and outputting an error for it? The hard-stop seems counter to what snaplogic is supposed to do with creating a document for each row of data from the query. Query Issue - Generic JDBC - Execute Using a Generic JDBC - Execute snap at the beginning of my pipeline with a hard-coded SQL query that has no issues running from any other place (workbench, phpstorm, etc) returns 800 results and an error instead of the full result-set. The error is “SQL [{my_query}] Zero date value prohibited” If I am running a single query, and am already getting 800 results before the error, then why and how is this error occurring, and why is it blaming the sql? I have other pipelines that have pulled in well more results than this query results in. I cannot find any reason that there would be an issue with a Date field as far as the SQL goes so this error response is very misleading. Looking at the stack trace: “ org.jooq.exception.DataAccessException: SQL [*my_query*] ]; Zero date value prohibited\n\tat org.jooq_3.9.1.MYSQL.debug(Unknown Source)\n\tat org.jooq.impl.Tools.translate(Tools.java:1983)\n\tat org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:676)\n\tat org.jooq.impl.CursorImpl$CursorIterator.fetchOne(CursorImpl.java:1569)\n\tat org.jooq.impl.CursorImpl$CursorIterator.hasNext(CursorImpl.java:1520)\n\tat org.jooq.impl.CursorImpl.fetch(CursorImpl.java:342)\n\tat com.snaplogic.snap.api.sql.DatabaseCursorImpl.fetchOne(DatabaseCursorImpl.java:78)\n\tat com.snaplogic.snap.api.sql.DatabaseUtils.processSelect(DatabaseUtils.java:251)\n\tat com.snaplogic.snap.api.sql.DatabaseUtils.processSelect(DatabaseUtils.java:284)\n\tat com.snaplogic.snaps.sql.SimpleSqlExecuteSnap.processQuery(SimpleSqlExecuteSnap.java:287)\n\tat com.snaplogic.snaps.sql.SimpleSqlExecuteSnap.processDocument(SimpleSqlExecuteSnap.java:245)\n\tat com.snaplogic.snaps.sql.SimpleSqlSnap.process(SimpleSqlSnap.java:270)\n\tat com.snaplogic.snap.api.ExecutionUtil.process(ExecutionUtil.java:106)\n\tat com.snaplogic.snap.api.ExecutionUtil.execute(ExecutionUtil.java:70)\n\tat ....... ” The only thing I can think of is that Snaplogic is trying to force a data-point into a Date field when the row has a null value for that field, but in the set of 800 results there are null values for date fields which can return null from the query already. I cannot see any reason why I should be seeing this error, and everything points to the Java component used to parse that row of data.