Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
How to set creation_time in SDK method build_secure_message_xml to adjust display to local time

I am trying to build an extension that will send a secure message on behalf of the customer. I am using build_secure_message_xml and setting creation_time=datetime.datetime.now(). This works fine in sandbox when the extension is running on my laptop. However, now that it has moved to a PTE the sent time that displays in the Messages tab and in Q2 Central is the UTC time when the message was created and not the localtime on the computer. Is there a recommended way to deal with timestamps in the SDK?

Posted 2 years ago
Votes Newest

Answers


Hello Matt,

Setting the timezone is going to depend on if this is going to be a single instance for a single FI.

If this is needed for a single FI, then staticly setting the timezone in the code is the simplest solution. Using the pytz library is typically how that is done, and you could set something in the db config if you wanted to changes this without deploying code.

If this is needed for multiple FIs which all could be in different timezones, the best solution is to make an HQ call. The GetVersion call will return a server time that can be used to get the timezone offset from UTC.
https://docs.q2developer.com/api_references/hq_api/q2_api/GetVersions.html

Let me know if there are any follow up questions!

Posted 2 years ago
Paden Rose
160 × 1 Administrator
0

Thank you. I think I have it now.

— Matt Guild   2 years ago
112 Views
1 Answer
2 years ago
2 years ago