Jim Posted August 7, 2023 Posted August 7, 2023 Hi, A question that I am sure I will still be asking in years to come the joys of regional time and dates... I have a progressive capture that captures a date time, this is then written to h_custom_21, When I format this date using the formatter I lose the DST value but all the documentation shows is it's in utc no z or anything on the value? So I can format the date to show how it is preferred but the time value is 1 hour behind? I have tried this not using h_custom_21 also and going straight from the form field to the formatter but I don't like this option anyway as its open to error when users have different format settings What is the obvious thing I am missing here?
Steve Giller Posted August 7, 2023 Posted August 7, 2023 19 minutes ago, Jim said: its open to error when users have different format settings The raw value from the Intelligent Capture answers will not be affected by User Preferences.
Jim Posted August 7, 2023 Author Posted August 7, 2023 @Steve Giller This is true but I am the presented with the same issue as using a date time field anyway
Gerry Posted August 7, 2023 Posted August 7, 2023 @Jim In Hornbill, Date/Time values internally are always represented and written to the database in UTC, that is, without any adjustments for timezones, this you can think of as an absolute point in time, relative to the international standard of Coordinated Universal Time (UTC) https://en.wikipedia.org/wiki/Coordinated_Universal_Time Throughout the system this is our standard and allows to display any date/time value in any local time and removes the need for us to try and track Timezones along with the date/time value. So all you need to do when working with these values is always work with them in UTC for calculations, then, when displaying, or including in a report for output to PDF or Excel, you need to convert the date/time UTC time point into local time. This is why when generating a report and in many other places you are required to specify a timezone. Gerry
Jim Posted August 7, 2023 Author Posted August 7, 2023 I appreciate that but when I write these values to a summary or activity after formatting them, how do I maintain the DST time?
Jim Posted August 7, 2023 Author Posted August 7, 2023 For example: the date time field is h_custom_21 which is obviously formatted by the system it self, but after changing the format like below I lose the hour that it should be when writing the formatted value to activities and summary's
James Ainsworth Posted August 7, 2023 Posted August 7, 2023 Hi Jim, Thanks for your post. On our wiki page for how to use Markup, there is a section titled Date Formatting. When updating either the summary or details of a request from a variable in a BPM workflow, if you surround that variable in a pair of single square brackets, it should be presented in the request summary or description in a format that is based on the user's regional settings. For example, here is a date variable that is taken from a Date/Time field on a request that includes the extra set of []. [&[global["flowcoderefs"]["getReqInformation"]["dateLogged"]]] After the BPM workflow has updated the summary or details, if you were to go into edit mode on the request you will see that the date looks like this However, the user with their time zone set to PST will see it as Both the difference in time zone and the date and time formats have been applied. I hope this helps and works with your scenario. 3
Jim Posted August 8, 2023 Author Posted August 8, 2023 This. This is brilliant! Thank you @James Ainsworth
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now