Skip to main content
Solved

How to extract date and time from .json URL?


Hi all,

 

I have a list of JSON historical file which contains date and time at the end of the URL. I would like to extract both date and time based on the URL and put it in the table.

 

I've extracted the date and time using the DateTimeStamper, but fails as it only generate current date and time.

 

Is there any suggestions on how can I extract the date and time from the URL?

Best answer by nielsgerrits

Multiple ways to do this. 

You can use StringReplacers to remove "http://apims.doe.gov.my/data/public_v2/caqm/" and ".json", then covert "2019/09/10/2300" the way you like it with a DateTimeConverter.

As an alternative for the StringReplacers you also can do it in one go using an AttributeCreator and

@ReplaceString(@ReplaceString(@Value(Url),"http://apims.doe.gov.my/data/public_v2/caqm/",""),".json","")

 

View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • May 25, 2021

Multiple ways to do this. 

You can use StringReplacers to remove "http://apims.doe.gov.my/data/public_v2/caqm/" and ".json", then covert "2019/09/10/2300" the way you like it with a DateTimeConverter.

As an alternative for the StringReplacers you also can do it in one go using an AttributeCreator and

@ReplaceString(@ReplaceString(@Value(Url),"http://apims.doe.gov.my/data/public_v2/caqm/",""),".json","")

 


  • Author
  • May 27, 2021
nielsgerrits wrote:

Multiple ways to do this. 

You can use StringReplacers to remove "http://apims.doe.gov.my/data/public_v2/caqm/" and ".json", then covert "2019/09/10/2300" the way you like it with a DateTimeConverter.

As an alternative for the StringReplacers you also can do it in one go using an AttributeCreator and

@ReplaceString(@ReplaceString(@Value(Url),"http://apims.doe.gov.my/data/public_v2/caqm/",""),".json","")

 

Thank you @nielsgerrits​. It works!


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