Ticket #8680 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SNSLiveEventDataListener: Bug in time parsing function on windows

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: critical Milestone: Release 3.1
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description (last modified by Martyn Gigg) (diff)

At line 688 of SNSLiveEventDataListener.cpp there is a call to strftime:

strftime( timeString, 64, "%FT%H:%M:%SZ", gmtime( &runStartTime));

The C++ standard reference for strftime says that:

  • %F=Short YYYY-MM-DD date, equivalent to %Y-%m-%d

but Windows doesn't support the %F specifiers: http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

We simply need to put the proper expanded version in, i.e "%FT%H:%M:%SZ" -> %Y-%m-%dT%H:%M:%SZ

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)

comment:2 Changed 7 years ago by Martyn Gigg

  • Status changed from new to inprogress

Fix strftime call for MSVC.

MSVC doesn't understand the %F specifier so we simply expand it to what it is abbreviated to under unix. Refs #8680

Changeset: 5c0defb28a6ebe03c587cee9d08dadbb71c3ea01

comment:3 Changed 7 years ago by Martyn Gigg

  • Status changed from inprogress to verify
  • Resolution set to fixed

Branch: bugfix/8680_snsliveeventdatalistener_time_parsing

Tester: Should be tested by someone at the SNS to check that the run start time is still parsed correctly.

comment:4 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:5 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to closed

It tested OK. Github were having issues so the hook didn't fire to do the auto-closing.

comment:6 Changed 7 years ago by Russell Taylor

Merge remote branch 'origin/bugfix/8680_snsliveeventdatalistener_time_parsing'

Full changeset: 230f4d44d34b5a058c270ae2a99e909eb91ad749

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9524

Note: See TracTickets for help on using tickets.