Question

Convert military time

  • 2 November 2018
  • 3 replies
  • 4 views

Badge

I have a date field called 'Date Started' and a text field called 'Time Started' in military format.Based on those two, I'd like to create a new column called 'Date Time Combo' (shown above) in the following format: mm/dd/yyy hh:mm AM/PM.

What's the best method to achieve this?


3 replies

Userlevel 4
Badge +30

Hi @mariofederis

I simulated here:

 

Atached the Workspace.

Workspace_DateTime.fmw

 

Thanks,

Danilo

Userlevel 2
Badge +17

I would recommend you to learn the powerful and flexible FME Date/Time functions in FME 2017.1+.

Example 1

Example 2

Userlevel 2
Badge +17

I would recommend you to learn the powerful and flexible FME Date/Time functions in FME 2017.1+.

Example 1

0684Q00000ArLAoQAN.png

Example 2

0684Q00000ArL7DQAV.png

Found another expression that returns date/time string with your desired format.

@Value(Date Started) @DateTimeFormat(@Format(%04d00,@Value(Time Started)),%l:%M %p)

0684Q00000ArMHUQA3.png

Reply