span8
span4
span8
span4
I've got a duration in seconds that I want to format as hours and minutes so I thought I'd tell the DateFormatter that it was %s (seconds since the epoch) and ask for the output %k:%M.
The output is an hour too long.(FME 2016.1.3.1)
6861 comes out as 2:56
7861 comes out as 3:11
That's not right,is it?
Could _epoch work to compare dates in TESTER??I tried your setting above,but it causes all my work to fall out the Failed port.I used DAteFormater for two fields set one less than the other.I also need is not NULL for both??Thx
That's really strange.In my time zone (UTC+09),this 亚搏在线workflow returns expected result.
format-epoch-with-dateformatter.fmw(FME 2016.1.3)
Result (Time Zone: UTC+09)
Attribute(encoded: utf-8): `_epoch' has value `1970-01-01T09:00:00'
How does the workspace work in your time zone > everyone?
Attribute(encoded: utf-8): `_epoch' has value `1970-01-01T00:00:00'
next week we are releasing FME 2017.0 - would you consider an upgrade?
In FME 2017 date,time,and datetime functionality has been greatly improved.While the new DateTimeFormatter is coming in FME 2017.1,in 2017.0 you can use datetime functions to do formatting (and much more!) For your task,the expression would look like
@DateTimeFormat(@DateTimeParse(6861,%s),%H:%M)
where 6861 can be replaced with an attribute name or an expression.
To answer your question re an hour offset:@takashiis right,DateFormatter with %s as a format string attempts to do correction for your system time UTC offset as
Date Attributes: _creation_instance (attribute)
Source Date Format: %s
Destination Format: @DateTimeFormat(@DateTimeParse(0,%s),%H:%M)
Hi@shepthedog63,where do you live?The epoch is 1970-01-01 00:00:00UTC.I suspect that time zone setting in your machine is UTC+01 (Germany etc.).
© 2019 亚搏在线Safe Software Inc |Legal