Skip to main content
Solved

Change /Date()/ to DateTime

  • February 13, 2020
  • 1 reply
  • 18 views

Hello there,

I try to read from a web service and write in Database but Datetime value from service came as string like /Date(1578560957763)/ . How can I change these string to actual datetime.

I use FME(R) 2019.2.2.0 (20200103 - Build 19817 - WIN64)

Thanks in advance.

Best answer by ebygomm

Extract the value (based on your example you could use a stringsearcher with regex (?<=Date\\()\\d+\\.?\\d* ) to get this) divide it by 1000 (to get seconds from milliseconds) and use a dateformatter with input format %s

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.

1 reply

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • February 13, 2020

Extract the value (based on your example you could use a stringsearcher with regex (?<=Date\\()\\d+\\.?\\d* ) to get this) divide it by 1000 (to get seconds from milliseconds) and use a dateformatter with input format %s