What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Retrieve Day of Year from DateTime tool

    Asked by jaymiller on December 04, 2014 at 12:52 PM

    Is is possible to retrieve the DoY from the DateTime tool?  I need the ability to calculate per diem based on a certain amount.

  • Profile Image

    Answered by Ben on December 04, 2014 at 02:15 PM


    Unfortunately it is not possible to get the day of the week at this time, unless you take the source code of your jotform and implement this into it directly.

    Now I would like to forward this as a feature to our developers, but could you please tell us if by the day of the year you mean day of the week (Monday, Tuesday, etc) or the day of the year such as 1, 2, 40, 54, 200, etc?

    If you want to get the day number it might be possible, but would require certain tweak each year to show correctly.

    Best Regards,

  • Profile Image

    Answered by Ben on December 04, 2014 at 02:26 PM


    I have made a quick sample of how you could calculate the day of the year.


    Do let us know if that is what you are after.

    Note: it only works for the current year.

    Best Regards,

  • Profile Image

    Answered by jaymiller on December 04, 2014 at 08:12 PM

    Thank you Ben,


    Could you please send me a copy or a link of your form?  


    The form needs to return the Day of the Year.  eg: 1/1/2014=1, 12/31/2014=365


    ps:  Using the current year is fine for what I need.


  • Profile Image
    JotForm Support

    Answered by jonathan on December 05, 2014 at 06:46 AM


    Can you please clarify also the requirement? 

    From what I understand initially, is you wanted to know the Name of DoY?

    There is a template in the JotForm Template that does this without using the form's source code. It only uses Calculation.

    Here is the template http://www.jotform.com/form-templates/show-day-of-the-week


    BUT if what you meant you need is instead the Number of Days within a Year, then this template does the same



    If you want to clone the demo jotform http://form.jotformpro.com/form/43375183857970 created by Ben,  then follow this user guide on how to



    Hope this help. Please inform us if you need further assistance.




  • Profile Image

    Answered by jaymiller on December 05, 2014 at 10:51 AM

    Thank you for all your help.


    What I mean by Day of Year is Day Number of the current year.  


    The day of year is the sequential day number starting with day 1 on January 1st.


    I see with Ben's example a year default is set by hard coding a Julian date type value.  In the example, the "year entry" for 2014 is set to "16070.96".  Does 16070 represent January 1st, 2014?

  • Profile Image

    Answered by Ben on December 05, 2014 at 12:07 PM


    Yes, I have hard coded the value of the January 1st of 2014 in the hidden box used to subtract the current/selected date value from, leaving the number of days in between.

    Now you can open the jotform and set it to 1st of January of 2014 and you will see it giving you 0 as the return value, since the days match.

    If you need it to be 1 instead of 0 you can always just add +1 to it.

    Do let us know if you have any further questions.

    Best Regards,