Solved

Datetime conversion in Data Collector

  • 28 February 2022
  • 1 reply
  • 789 views

Userlevel 3
Badge +1

Hi there,

 

How do I get to know the Time Zone that my Data Collector is set to?

How do I change the Time Zone of my Data Collector?

 

Reason: 

I use the pipeline:startTime() function and it returns the time in UTC, I would ideally like to have it as Australia - WST.

 

Also, let me know how can I convert a UTC datetime value to a datetime value in AWST timezone.

 

Note : I am on the DataOps platform.

 

Cheers,

icon

Best answer by Srinivasan Sankar 1 March 2022, 12:08

View original

1 reply

Userlevel 3
Badge +1

Dear Community Members, 

 

I would like to share the answers that I received from various sources to the question I posted.

 

How do I get to know the Time Zone that my Data Collector is set to?

This question is unclear.

If you are curious what would StreamSets functions like the one below would return, “it’s always in UTC”.

  • time:now()
  • pipeline:startTime()
  • job:startTime()

 

Reason:

The above functions just refer to an instance of java.util.Date that is always in UTC.

 

If you wonder, why the pipeline start time and job start time that you see in StreamSets GUI is shown in your local time - this is because StreamSets uses browser settings.

 


 

How do I change the Time Zone of my Data Collector?

I don’t think this question is valid. 

 


 

How can I convert a UTC datetime value to a datetime value in AWST time zone?

-- Thanks to Roman Bukarev - StreamSets Customer Success Representative --

${time:millisecondsToDateTime(time:dateTimeToMilliseconds(pipeline:startTime())+time:dateTimeZoneOffset(pipeline:startTime(),'Australia/Perth'))}

 


 

 

Hope this info. is useful to anyone new to StreamSets Data Collector.

Thanks.

 

 

Reply