Skip to main content
Question

DateTime Format Issue

  • September 14, 2017
  • 8 replies
  • 39 views

Forum|alt.badge.img+1

Why does this not work?

SSIS Errors (Since @DateTimeFormat(@Value(init_start_time),'%b/%e/%Y') at @DateTimeFormat(@Value(init_start_time),'%T'))

8 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 14, 2017

Hi @deanrother, what value does the attribute "init_start_time" store?


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 14, 2017

What version of FME are you using? The expression works fine in FME 2017.1 if the "init_start_time" stores a date/time string formatted in YYYYmmddHHMMSS. However, FME 2017.0 possibly has a bug here.


Forum|alt.badge.img
  • September 15, 2017

Hi @deanrother

 

this expression should work if init_start_time is a valid datetime value in FME datetime format. If init_start_time is not a valid datetime value, you will find a warning in the log explaining why the expression failed. This is what I got with init_start_time = 3:

|WARN  |AttributeCreator: Failed to parse '3' as a datetime value. For FME datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm
|WARN  |AttributeCreator: Failed to evaluate expression '@DateTimeFormat(3,'%b/%e/%Y')'.  Result is set to null.
|WARN  |AttributeCreator: Failed to parse '3' as a datetime value. For FME datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm
|WARN  |AttributeCreator: Failed to evaluate expression '@DateTimeFormat(3,'%T')'.  Result is set to null.

Can you find any warnings in your log?


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 15, 2017
lenaatsafe wrote:

Hi @deanrother

 

this expression should work if init_start_time is a valid datetime value in FME datetime format. If init_start_time is not a valid datetime value, you will find a warning in the log explaining why the expression failed. This is what I got with init_start_time = 3:

|WARN  |AttributeCreator: Failed to parse '3' as a datetime value. For FME datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm
|WARN  |AttributeCreator: Failed to evaluate expression '@DateTimeFormat(3,'%b/%e/%Y')'.  Result is set to null.
|WARN  |AttributeCreator: Failed to parse '3' as a datetime value. For FME datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm
|WARN  |AttributeCreator: Failed to evaluate expression '@DateTimeFormat(3,'%T')'.  Result is set to null.

Can you find any warnings in your log?

Hi @LenaAtSafe, you are right in FME 2017.1, but the expression returned <null> in FME 2017.0, even if the source date/time was formatted in YYYYmmddHHMMSS.

 

0684Q00000ArMd9QAF.png

 

AttributeCreator: Failed to evaluate expression '@DateTimeFormat(20170915123456,'%b/%e/%Y')'.  Result is set to null.
Storing feature(s) to FME feature store file `.\mapping_log.ffs'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `Creator_CREATED'
Attribute(string)        : `_formatted' is <null>
Attribute(string)        : `fme_expression_warnings{0}.attributeName' has value `_formatted'
Attribute(string)        : `fme_expression_warnings{0}.message' has value `Failed to evaluate expression '@DateTimeFormat(20170915123456,'%b/%e/%Y')'.  Result is set to null.'
Attribute(string)        : `fme_expression_warnings{0}.transformerName' has value `AttributeCreator'

Forum|alt.badge.img
  • September 15, 2017
takashi wrote:
Hi @LenaAtSafe, you are right in FME 2017.1, but the expression returned <null> in FME 2017.0, even if the source date/time was formatted in YYYYmmddHHMMSS.

 

0684Q00000ArMd9QAF.png

 

AttributeCreator: Failed to evaluate expression '@DateTimeFormat(20170915123456,'%b/%e/%Y')'.  Result is set to null.
Storing feature(s) to FME feature store file `.\mapping_log.ffs'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `Creator_CREATED'
Attribute(string)        : `_formatted' is <null>
Attribute(string)        : `fme_expression_warnings{0}.attributeName' has value `_formatted'
Attribute(string)        : `fme_expression_warnings{0}.message' has value `Failed to evaluate expression '@DateTimeFormat(20170915123456,'%b/%e/%Y')'.  Result is set to null.'
Attribute(string)        : `fme_expression_warnings{0}.transformerName' has value `AttributeCreator'
Oh, you are right! 2017.0 does not support %e, this flag was implemented in 2017.1. 

 

 


Forum|alt.badge.img+1
  • Author
  • September 15, 2017

I'm on 2017.0. So maybe a bug.


Forum|alt.badge.img
  • September 15, 2017
deanrother wrote:

I'm on 2017.0. So maybe a bug.

@deanrother

 

it is not really a bug: %e was implemented in 2017.1, i.e. you are trying to use a flag that is not supported by 2017.0. Would you consider upgrading to 2017.1?

 


Forum|alt.badge.img+1
  • Author
  • September 15, 2017
lenaatsafe wrote:
@deanrother

 

it is not really a bug: %e was implemented in 2017.1, i.e. you are trying to use a flag that is not supported by 2017.0. Would you consider upgrading to 2017.1?

 

Thank you for the clarification. It's clearly not a bug.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings