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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 737 Beast Mode
- 55 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive