Skip to main content
Question

Timestamps/date time problem


Forum|alt.badge.img

Hi, I have an issue whereby the datetime formats are coming out incorrectly.

I have a number of scripts that read json formats directly from a couchbase database, and spits them out in human readable excel format, using the FileNamePartExtrator transformer. It all works great except for the inspection and submission times. They seem to be getting mangled. I am 6 hours behind UTC, but the FME reader is already altering the timestamps before doing anything to it (I checked this in the reader preview). For example, I have a correct inspection timestamp in the database that reads 15:58:13 but it is getting populated in the output spreadsheet as 09:58:13

It is being read in as timestamp format and being outputted as datetime format. I would just like to have them outputted in the same time that they are getting read and stop FME from changing them without my permission. I have tried various date & time formats in the output writer to convert them back but nothing seems to work, for example: @TimeZoneSet(batteryunitinspectiondocument.auditinfo.inspectedtime, +06:00, local) does not work (This is just one example of many)

Either the script fails, or there's no change or there's nothing in the excel column depending on the syntax I've been trying.

Thanks

Carl

5 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • July 19, 2019

Hi @ctownsend, if you connect the Inspecter to the reader feature type and run, how is the date/time value displayed on the Table View?


Forum|alt.badge.img
  • Author
  • July 19, 2019

The inspector is showing the wrong time, right from the start....095813. It should be 155813/ It seems to be mangling the timestamp before it even does anything (!). I don't want it altering the timestamp...I just want to parse the correct timestamp all the way through. If I cannot stop FME from doing this, I would like to find a way to convert it back, and to know the syntax on how to do it.

 

Here's a screenshot, direct from the database:

This is what I expect FME to be reading.

(EDIT): It also has the day wrong, it should be the 17th, not the 19th...and the submitted time is also wrong.


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • July 19, 2019

Since it's unclear how you are reading source dataset, cannot specify why the automatic time zone conversion happens, but if you need to add 6 hours to the date/time value, it would be easy to use the DateTimeCalculator transformer.


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • July 19, 2019
ctownsend wrote:

The inspector is showing the wrong time, right from the start....095813. It should be 155813/ It seems to be mangling the timestamp before it even does anything (!). I don't want it altering the timestamp...I just want to parse the correct timestamp all the way through. If I cannot stop FME from doing this, I would like to find a way to convert it back, and to know the syntax on how to do it.

 

Here's a screenshot, direct from the database:

This is what I expect FME to be reading.

(EDIT): It also has the day wrong, it should be the 17th, not the 19th...and the submitted time is also wrong.

It's strange that date is also wrong...

I don't think FME support Couchbase. How do you read the features from the Couchbase database?


Forum|alt.badge.img
  • Author
  • July 19, 2019

I'm using the CData ODBC driver to connect to CouchBase....


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings