Solved

HTML Report Generator - Time Output Problem

  • 18 January 2022
  • 4 replies
  • 4 views

Badge

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.

icon

Best answer by geomancer 18 January 2022, 19:12

View original

4 replies

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

 

 

Userlevel 3
Badge +33
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.

Badge

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!

Badge
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)

 

Reply