Skip to main content
Question

Convert military time

  • November 2, 2018
  • 3 replies
  • 33 views

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • November 2, 2018

Hi @mariofederis

I simulated here:

 

Atached the Workspace.

Workspace_DateTime.fmw

 

Thanks,

Danilo


takashi
Celebrity
  • 7843 replies
  • 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
Celebrity
  • 7843 replies
  • November 4, 2018

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