Skip to main content
Solved

HTML Report Generator - Time Output Problem

  • January 18, 2022
  • 4 replies
  • 113 views

Forum|alt.badge.img

Hello everyone,

 

So I would like to generate a HTML report by using "HTML Report Generator".

For the final product, I would like to generate the report with the "current time" on the HTML page.

 

This is what I write in the text editor:

 

 KE Indoor run on @DateTimeFormat(@DateTimeNow(local),ISO)

 

The output is:

 

 KE Indoor run on 2022-01-18T16:58:52.1754106+08:00

 

However, this is what I want for the result:

 

 KE Indoor run on 2022-01-18 16:58:52

 

May I ask how can I fix the problem?

 

Thank you in advance.

Best answer by geomancer

KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %H:$M:$S),0,19)

or

KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %T),0,19)

$S (for seconds) or $T (equal to %H:%M:%S) always includes partial seconds, so you have to remove those.

View original
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.

4 replies

jr2
Contributor
Forum|alt.badge.img
  • Contributor
  • January 18, 2022

Hi, just add the format you would like to have: Ex: @DateTimeFormat(@DateTimeNow(),%B %d %Y)

 

See all format :

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/!Transformer_Parameters/Date-Time-Functions.htm

 

 


geomancer
Evangelist
Forum|alt.badge.img+69
  • Evangelist
  • Best Answer
  • January 18, 2022
KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %H:$M:$S),0,19)

or

KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %T),0,19)

$S (for seconds) or $T (equal to %H:%M:%S) always includes partial seconds, so you have to remove those.


Forum|alt.badge.img

Hi, just add the format you would like to have: Ex: @DateTimeFormat(@DateTimeNow(),%B %d %Y)

 

See all format :

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/!Transformer_Parameters/Date-Time-Functions.htm

 

 

Thank you very much!


Forum|alt.badge.img
KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %H:$M:$S),0,19)

or

KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %T),0,19)

$S (for seconds) or $T (equal to %H:%M:%S) always includes partial seconds, so you have to remove those.

This is exactly what I want.  Thank you so much!

 

   KE Indoor run on @Substring(@DateTimeFormat(@DateTimeNow(local),%Y-%m-%d %T),0,19)