Date Time Translation Output

I am using a series of date time translation modules to break up a date into its individual components.
There are three of them with the output being yyyy, mm, dd (respectively).

If I input a date of 5/15/2018 I would expect the output of the three modules to be 2018, 05, and 15. Instead i am receiving the full date still as the output. Any reason why this should be happening?

I have tried closing my browser and clearing the cache to see if that fixed it and it did not.

photo for reference

I just created a similar setup and it worked fine, other than a bug that I just found. If you look at my example, the only difference is that you have the stream and the text and the same value. Maybe try changing that and going from there.

The bug i found was when only outputting the day in the middle module, the date was 1 day earlier. In my example the 25th was outputted as “24”. it was doing that with every day, and type of day I entered.

You need to understand the difference between wires that contain data streams (XML documents) and wires that contain scalar values (text & numbers).

The DateTime - Translation module processes data streams, not scalar values. Here is the correct way to use it:

You can see on the left side it emits the month as expected.

You are not processing a data stream in your screenshot, as evident from the “part_output” which is how modules emit scalar values.

The problem is being caused by the Split module, which lets both data streams and scalars be split.

So see here:

The editor won’t let the output from Text Builder module be wired directly to the DateTime module. But you can do what I show b/c the editor doesn’t yet have the smarts to know what is actually being emitted by the Split. This arrangement does not work.

I will investigate what Darren just reported about the day issue.

1 Like

Gotcha. So instead of using a single value pass the full xml then just select the value in the translation module.

Right.

The day issue is being caused by timezone. By passing a date without a timestamp, the module thinks you mean 00:00:00 (midnight). The server’s timezone is UTC. Your timezone in the browser is probably Central US. So you are a day behind UTC when it is midnight in Britain. The solution is to add a timestamp to the date value that takes into account the timezone, or use the Timezone Offset in the module.

Note that when the assembly runs on the server, the conversion uses the server’s timezone. So in that case you don’t want to modify the timezone.

You probably want to use a When In module to control timezone manipulations depending on whether the assembly is being run on the server or not.

Maybe a better solution to avoid timezone issues is to just parse the date string using JavaScript/Java/PHP.