Skip to main content
Question

Convert Date in format 2023-09-13(YYYY-MM-DD) to Timestamp in milliseconds

  • September 13, 2023
  • 2 replies
  • 109 views

We want to convert Date in format 2023-09-13(YYYY-MM-DD) to Timestamp in milliseconds 1694563200000 using FME Transformer but no FME transformer is able to convert date to milliseconds.

For example 2023-09-13 -> 1694563200000

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+64

One way to solve this is to add the time before the DateTimeConverter using an AttributeCreator.

@Value(Date) 00:00:00.000

 Then feed it to the DateTimeConverter using

%Y-%m-%d %H:%M:%S$

as input format and

%Es

as output format.

 


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • September 13, 2023

You can convert to ISO date to seconds using input format of %Y-%m-%d$ and output format of %Es

imageThen multiply the result by 1000 to get milliseconds