MagicETL Transform Settings: Timestamp to Date
I can't seem to find a clear answer as to what is happening here, so I'm turning to the community.
- I have a dataset with a timestamp field,
createdAt
- The dataset arrives to Domo in UTC, and my company timezone settings are converting it to USA\Eastern Time. This is working as expected.
- Using this as an input dataset in MagicETL, I get the same expected timestamps.
The fun begins, however, when I change the field to Date on the input step (Input Dataset tile > Configuration > Data Handling > Column Type
Despite the timezone settings configured to inherit, I now get a date of 2024-11-12, rather than the 2024-11-11 it should be (see first screenshot). No matter what timezone I pick, I always get 2024-11-12.
What on earth is going on here?
Best Answers
-
When you set the type to "Date" in the Input DataSet's Data Handling section and the source data is CSV (as it is in many cases), it's not converting a timestamp to a date. It's converting a string to a date; the string is the text in the CSV field. The String to Date conversion discards all time and zone information, preserving only the year, month, and day from the string. The timezone setting has no effect on string to date conversion; it has no effect on any operation that does not involve timestamps.
You've said the timestamps in question are written to Domo as UTC, which means the timestamp 2024-11-11T22:37:38-05:00 is represented in the CSV file as the string 2024-11-12T03:37:38 or something similar. The date in the string will be 2024-11-12.
The Data Handling section is best used when you suspect the type that Domo selected for the column is incorrect. In this example, timestamp is the correct type, so it should be left as timestamp. Converting the timestamp to a date in a downstream tile will behave as expected; timestamp to date conversion does respect the timezone setting.Randall Oveson <randall.oveson@domo.com>
0 -
Unless it's a Cloud Amplifier DataSet, which I don't believe it is, then the connector is exporting the data from your DynamoDB. Most connectors export to CSV files. Those files are the form in which Magic ETL sees your data.
Randall Oveson <randall.oveson@domo.com>
0
Answers
-
Have you run it through and looked at the completed output dataset? I have found the preview within Magic ETL to be misleading on date/times.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
When you set the type to "Date" in the Input DataSet's Data Handling section and the source data is CSV (as it is in many cases), it's not converting a timestamp to a date. It's converting a string to a date; the string is the text in the CSV field. The String to Date conversion discards all time and zone information, preserving only the year, month, and day from the string. The timezone setting has no effect on string to date conversion; it has no effect on any operation that does not involve timestamps.
You've said the timestamps in question are written to Domo as UTC, which means the timestamp 2024-11-11T22:37:38-05:00 is represented in the CSV file as the string 2024-11-12T03:37:38 or something similar. The date in the string will be 2024-11-12.
The Data Handling section is best used when you suspect the type that Domo selected for the column is incorrect. In this example, timestamp is the correct type, so it should be left as timestamp. Converting the timestamp to a date in a downstream tile will behave as expected; timestamp to date conversion does respect the timezone setting.Randall Oveson <randall.oveson@domo.com>
0 -
Thanks @rco ! That maybe explains it; except this is a DynamoDB dataset where the field is stored as timestamp. But perhaps something is happening in the connector which is causing Domo to perform the string to date conversion as you mentioned?
Here's the input dataset in question, it is definitely writing to Domo as a timestamp before it ever enters the ETL.
Good to know RE: best practice on using the Data Handling section! I appreciate the insight.
0 -
@MarkSnodgrass That's a good call — I do think that was part of my problem last night. Thank you!
0 -
Unless it's a Cloud Amplifier DataSet, which I don't believe it is, then the connector is exporting the data from your DynamoDB. Most connectors export to CSV files. Those files are the form in which Magic ETL sees your data.
Randall Oveson <randall.oveson@domo.com>
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive