question

Upvotes
Accepted
23 0 0 1

How to change Timestamp

How do i change the

"Condition": {

"MessageTimeStampIn": "GmtUtc", to UTC+9 , and how do i show the timestamp to be Tokyo/Osaka?

#technology#contenttimestamp
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
5.6k 18 2 7

Posting the answer from the case for future reference:

All currency pairs and currency update in GMT/UTC only. In Tick History Report, the output settings can only be set to “Gmt/Utc” or “LocalExchangeTime”. For currencies / forex, local “Exchange” time is also Gmt/Utc as source is from Refinitv.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.6k 18 2 7

Hi @jolin.majmin


If the question about LSEG Tick History, According to the documentation, MessageTimeStampIn can accept either GmtUtc or LocalExchangeTime.

screenshot-2024-04-15-at-121130.png

Hope this helps.


Best regards,

Haykaz


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
23 0 0 1

I understand this, however I am not certain what the LocalExhangeTime would be for each currency pair? for some I would guess JPY would be TOKYO, but what if I chose AUDZAR? what is the LocalExchageTime for this pair, for example? So, it would be better for me, if i could choose my timezone reference.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.6k 18 2 7

I don't think it is possible to add timezone reference, my colleagues (@Jirapongse I would appreciate your input here) may correct if I am wrong. As for the LocalExhangeTime for different pairs, I would advice raising a content query via my.refinitiv.com.


Best regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
23 0 0 1

I have tried

"Condition": {

"MessageTimeStampIn": "LocalExchangeTime", ....the Date-Time column is still of the form, ISO 8601, "YYYY-MM-DDTHH:MM:SS.sssZ". I do not see any difference to using GmtUtc. Please advise as to how i can obtain UTC+9 for example, WITHOUT changing the timestamp after the extraction


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.6k 18 2 7

Hi @jolin.majmin ,


Please add "DateRangeTimeZone": "Local Exchange Time Zone" into your conditions, that should return in local time zone:

            "conditions": {
                "MessageTimeStampIn": "LocalExchangeTime",
                "DateRangeTimeZone": "Local Exchange Time Zone",
                "ReportDateRangeType": "Range"
             }


Best regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
23 0 0 1

I have tried this. Unfortunately, it yields no different values to using "GmtUtc"capture.png


capture.png (35.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.6k 18 2 7

Hi @jolin.majmin ,


Please also add "Trade - Exchange Time" to the ContentFieldNames and would you mind posting your code here, so I investigate further in case of further questions?


Bes regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
23 0 0 1
requestUrl='https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractRaw'

requestHeaders={"Prefer":"respond-async","Content-Type":"application/json","Authorization": "token " + token}

requestBody={
  "ExtractionRequest": {
    "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",
    "ContentFieldNames": ["Close Ask","Close Bid","High Ask","High Bid","Low Ask","Low Bid","No. Asks","No. Bids",
      "Open Ask","Open Bid", "Trade - Exchange Time"],
    "IdentifierList": {
      "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",  
      "InstrumentIdentifiers": [{"Identifier": ticker1,"IdentifierType": "Ric"},
                                #{"Identifier": ticker2,"IdentifierType": "Ric"}
                               ],
      "UseUserPreferencesForValidationOptions": "false"
    },    
    "Condition": {
      "MessageTimeStampIn": "LocalExchangeTime", #"GmtUtc",
      "DateRangeTimeZone": "Local Exchange Time Zone",  
      "ReportDateRangeType": "Range",
      "QueryStartDate":QueryStartDate ,
      "QueryEndDate": QueryEndDate,
      "SummaryInterval": "OneMinute",
      "TimebarPersistence": "false",
      "DisplaySourceRIC": "true"
    }
  }
}

r2 = requests.post(requestUrl, json=requestBody,headers=requestHeaders)

#Display the HTTP status of the response
#Initial response status (after approximately 30 seconds wait) is usually 202
status_code = r2.status_code
print ("HTTP status of the response: " + str(status_code))

if status_code == 200 :
    r2Json = json.loads(r2.text.encode('ascii', 'ignore'))
    jobId = r2Json["JobId"]
    print ('\njobId: ' + jobId + '\n')
    notes = r2Json["Notes"]
    print ('Extrraction notes:\n' + notes[0])
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
23 0 0 1

if i add "Trade - Exchange Time" as suggested, there is an error. You suggestion does not work.

HTTP status of the response: 400
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.6k 18 2 7

Hi @jolin.majmin ,


Thanks for sharing the code, indeed if you are using TickHistoryIntradaySummariesExtractionRequest "Trade - Exchange Time" will not be available. I have checked the available fields and didn't seem to find an equivalent for it. I have created a content query (case id: 13483218) on your behalf and the team may better assist you with your question.


Best regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.