Extract timezone as a number

  • theblumeprojectdotcom
    Asked on September 17, 2024 at 4:15 AM

    Hi


    I have to capture a users required start date, start time as well as timezone for a product delivery. The best solution I found on Jotform was to use 3 separate fields (https://www.jotform.com/build/242596491316059).

    I require the value of the timezone (which a user selects from your dropdown list with the predefined timezone set.) I use this value in calculations. However, your selection gives me for instance Tell City, Indiana (GMT-05:00) How would I achieve getting -5 from that example (or 3 from this example: Addis Ababa (GMT+03:00))

    I then pass this on via API to airtable for other scripts based on formulas using this value


    Thanks

  • Joshua_T JotForm Support
    Replied on September 17, 2024 at 4:23 AM

    Hi theblumeprojectdotcom,

    Thanks for reaching out to Jotform Support. Unfortunately, I did not quite understand what you were trying to accomplish on your form. Can you share more details?

    I visited the link to your form, and I was able to select Addis Ababa (GMT+03:00) from the dropdown element. Check out this screenshot below:

    Extract timezone as a number Image 1 Screenshot 20

    From here, can you tell us how would you like to proceed, and what output are you trying to get?

    Once we have a better understanding of the issue, we can move forward with a solution.

  • theblumeprojectdotcom
    Replied on September 17, 2024 at 8:11 AM

    This is an extract of the payload I receive after a form submission. I cant do any mathematical calculations on that as its a text string. I just want the numeral 3, then I know this persons time zone is +3 from GMT. I'm trying to find a way to knot have to use regex to get it from that field. So I'm asking if you have any functions in Jotform that can extract the numeral from the timezone. Does that make sense?

    "q43_typeA43": "Addis Ababa (GMT+03:00)",


  • Joeni JotForm Support
    Replied on September 17, 2024 at 8:54 AM

    Hi theblumeprojectdotcom,

    Can you please tell us how you extracted the submissions including the time zone? Also, can you please send us a screenshot of the extracted time zone within the submission data so we can have a better idea of how to perform a better calculation to meet your desired requirement?

    When I cloned your form and tried to replicate the issue it seems to be working properly. Take a look at the screenshot below:

    Extract timezone as a number Image 1 Screenshot 20Once we hear back from you, we'll be able to help you with this.

  • theblumeprojectdotcom
    Replied on September 17, 2024 at 9:00 AM
    Hi
    I am unsure of how to explain it differently - I am nit sure why we are talking past each other. There is no problem with the timezone coming through, I can’t do any calculation on it as it’s a text field. I am asking if you have any way of extracting just the number in the timezone field so that I can use it in formulas
    I sued one of your competitors products and they have an ability to extract numbers from the timezone field, so that you can do calculations with it
    ...
  • Elizer JotForm Support
    Replied on September 17, 2024 at 11:37 AM

    Hi theblumeprojectdotcom,

    I understand what you’d like to do, but I’ll need a bit of time to work out a solution. I’ll get back to you shortly.

    We appreciate your patience while we work on a solution.

  • Elizer JotForm Support
    Replied on September 17, 2024 at 2:08 PM

    Hi theblumeprojectdotcom,

    Thank you for your patience. Can you go ahead and try  the steps below and let us know how it goes?

    1. In Form Builder, click Add Element
    2. Then, click Widgets and Form Calculation
    3. In Form Calculation field, click on the Wand Icon.
    4. Select Add Field, then choose Time zone.
    5. Type /100 then click Save.

    Check out my results in the screencast and screenshot below:

    Extract timezone as a number Image 1 Screenshot 30

    Extract timezone as a number Image 2 Screenshot 41

    Give it a try and let us know if you need any other help.


  • theblumeprojectdotcom
    Replied on September 18, 2024 at 8:45 AM
    Hello
    That is perfect, thank you soo much
    Kind regards
    Jaco
    ...
Your Answer