[QFJ-232] Transact time - What is the time zone? Created: 30/Aug/07 Updated: 02/Sep/07 Resolved: 02/Sep/07 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Other | Priority: | Default |
Reporter: | Parag Mehta | Assignee: | Steve Bate |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
Steve, anyone, What exactly is the timezone of the date (long) parsed out of the Transact time. Seems to me it is local, and if a UTC time is required, a conversion is necessary. Pls note: this is not a display (format) question, only what timezone is the long value represented in. Cheers. |
Comments |
Comment by Toli Kuznets [ 30/Aug/07 ] |
Parag, There are two different constructors of TransactTime - one that takes a Date (in which case it's up to you what timezone it's in). Otherwise, if you are just using the default QFJ behaviour, since the TransactTime inherits from the DateField object, all the newly created TransactTime fields are done in UTC timezone. See the DateField.createDate() function: http://quickfixj.svn.sourceforge.net/viewvc/quickfixj/trunk/core/src/main/java/quickfix/DateField.java?view=markup DateField use a default Calendar that's set to a UTC timezone. |
Comment by Parag Mehta [ 30/Aug/07 ] |
My question was from the perspective of getting a filled transact time out of an ExecutionReport or Allocation message. Which method will it use in this case. I.e., in this case: long time = allocation.getField(new TransactTime()).getValue().getTime(); // What is timezone for 'time'? |
Comment by Steve Bate [ 31/Aug/07 ] |
The long value is "the number of milliseconds since January 1, 1970, 00:00:00 GMT" (per the java.util.Date docs). Are you asking what timezone is used to parse the string from the FIX message field? If so, UTC is used to parse the timestamp string into a java.util.Date. What causes you to think you are getting a local time? |