[QFJ-250] Expiry Time UTC Conversion. Created: 27/Sep/07  Updated: 06/Oct/07  Resolved: 06/Oct/07

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: None

Type: Other Priority: Default
Reporter: Parag Mehta Assignee: Steve Bate
Resolution: Fixed Votes: 0
Labels: None
Environment:

all



 Description   

Question about expiry time problem. We set it to UTC (today: 00:00:00) and pass it down to ExpiryTime constructor.

Date date = (09-26-2007: 00:00:00);
// If UTC formatter is used this will print today 00:00:00 UTC
ExpiryTime expiryTime = new ExpiryTime(date);

The problem is when it's send over to FIX, the time zone diff is somehow added to the converted string, e.g.: 22:00 below and the main problem: today becomes today-1 (9/26 becomes 9/25).
126=20070925-22:00:00

Is this correct? From all the documentation I read, it seems if UTC is passed, no conversion should happen and the date to string conversion should keep it 09-26:00:00 all along.

It would also possibly help to have another ExpiryTime(String) constructor; since FIX UTC timestamp is eventually a string.

Thanks.
Parag



 Comments   
Comment by Steve Bate [ 28/Sep/07 ]

Are you sure you are creating the date in the correct time zone?

The following unit tests passes...

public void testUtcFieldFormatting()

{ Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.set(2008, Calendar.JANUARY, 1, 0, 0, 0); c.set(Calendar.MILLISECOND, 0); ExpireTime expireTime = new ExpireTime(c.getTime()); Message m = new Message(); m.setField(expireTime); assertEquals("9=26126=20080101-00:00:00.00010=193", m.toString()); }

As for your question about passing a String. You can create a StringField directly and use that
to set the field. Just be sure to format the string correctly.

Generated at Sat Nov 23 10:29:04 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.