Question

Convert datestamp values to friendly UK date format

  • 13 June 2024
  • 5 replies
  • 36 views

Userlevel 2
Badge +7

Hi,

 

I have a geojson including an attribute with datestamp values. An example value is 202410231836 (year, month, date, hours, minutes - yyyy mm dd hh mm). These are important as I’m running testFilters with it. 

 

However I would also like to create a parallel attribute showing an easy to read UK date value from it. So, 202410231836 would convert to ‘31/10/2024 18:36’.

I’ve been looking at DateTimeConverter transformer but couldn't work out what import format to use and what output format to pick - assuing that DateTimeConverter is the one to use.

Any advice would be appreciated.

 

Thanks,

Stuart

 


5 replies

Userlevel 3
Badge +5

if you leave the input format blank it should autodetect that? if not use the quick guide reference at the bottom to construct it 

 

 

 

Userlevel 5
Badge +32

if you leave the input format blank it should autodetect that? if not use the quick guide reference at the bottom to construct it

 

It will only autodetect the FME format or ISO formats. But this one is pretty straightforward. It looks like %Y%m%%d%H%M for input and %d/%m/%Y %H:%M for output.

Userlevel 2
Badge +7

Thanks for that @mark2atsafe .

 

I’ve tried that, assuming that I use End_date and Start_date as the ‘Datetime_attributes’…

 

But I get this result…

 

 

Thanks,

Stuart

 

Userlevel 3
Badge +5

Thanks for that @mark2atsafe .

 

I’ve tried that, assuming that I use End_date and Start_date as the ‘Datetime_attributes’…

 

But I get this result…

 

 

Thanks,

Stuart

 

looks like there is an extra % in the input?

 

%Y%m%%d%H%M  - %Y%m%d%H%M

Userlevel 2
Badge +7

Hi @mark2atsafe . That is resolved now. Thanks.

Reply