Skip to main content
Question

Convert military time


Forum|alt.badge.img

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

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • November 2, 2018

Hi @mariofederis

I simulated here:

 

Atached the Workspace.

Workspace_DateTime.fmw

 

Thanks,

Danilo


takashi
Influencer
  • November 3, 2018

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

Example 1

Example 2


takashi
Influencer
  • November 4, 2018
takashi wrote:

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


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