Looking for help with time/timezone conversions

Hey everyone! Hopefully somebody can help point me in the right direction. I’ve created a new module in SuiteCRM to help our employees all over the world track their site visits. I have two fields for time in and time out. For the users, this works fine as everything is saved in UTC and it displays it with the User’s Timezone offset. We do however need to keep “local” timestamp somewhere in the DB so we can run reports and track visits based on the actual local time.

For example, if a user in Denver logs a visit from 9AM to 5PM, when our users in NY look at that, they are seeing 11AM to 7PM. I would like to be able to use a logic hook to create secondary “Local Time Stamp” fields so we can run reports for our users and actually see the visits in local time. I’m falling flat in my attempts. Any help would be appreciated!

This is so simple. Just do 1 thing. I hope you will be saving the Visitor Time Zone information in the table. So you can write the CRON job something like visit time is 11AM and user timezone is UTC +1, so in the database it will be saved as 10AM, you can make another field in the CRM, now in the cron job you can write the code to convert the saved time as per the Timezone and to save it into new field

Another option can be to do this step while saving the interaction records .

Please note that you should create the new field as a TEXT field to put the local timestamp into it so that it should not be affected by the User’s setting.