Espo Formula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gri.N
    Member
    • Mar 2023
    • 32

    #1

    Espo Formula

    Добрый день друзья !

    Стала задача разобраться с датой и временем

    Воткнулся в проблему как из 2025-06-29 09:58:33 такого значения получить 20250629095833 ?? Может для кого то это просто , буду рад помощи !

    Задача стоит в том что б дата и время завершения Задачи вычесть дату и время начала Задачи , что б понять сколько времени было затрачено на выполнение Задачи.

  • shalmaxb
    Senior Member
    • Mar 2015
    • 1704

    #2
    You need datetime/diff for that: (Для этого вам понадобится datetime/diff:

    Code:
    minutes = datetime\diff(end, start, 'minutes');
    and if you want to convert it in hours: (и если вы хотите преобразовать его в часы:

    Code:
    hours = minutes/60;

    Comment

    • Gri.N
      Member
      • Mar 2023
      • 32

      #3
      Originally posted by shalmaxb
      You need datetime/diff for that: (Для этого вам понадобится datetime/diff:

      Code:
      minutes = datetime\diff(end, start, 'minutes');
      and if you want to convert it in hours: (и если вы хотите преобразовать его в часы:

      Code:
      hours = minutes/60;
      As it will be in my example ?

      Comment


      • shalmaxb
        shalmaxb commented
        Editing a comment
        This is not difficult:

        minutes: You create a custom fields with the name minutes
        Then you apply the formula to this field, where it will calculate the difference between the end (your fieldName with the value for the end) and the start (your fieldName with the start of the process.
        The result in the field minutes will show the passed minutes from start to end.

        The second formula, converts the minutes in hours. For that you will have to create a float field (one or two decimals) with the name hours.

        As I do not know the names for start and end, you have to put these for yourself.
    • Gri.N
      Member
      • Mar 2023
      • 32

      #4
      Originally posted by Gri.N

      As it will be in my example ?

      start date "dateStart" end date "dateEnd" these are the names of the fields

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1704

        #5
        ok, what do you think? Where is the solution? Look, this is very, very easy. Don`t expect this forum to deliver ready-to-use solutions for your custom purpose. It is necessary to work a bit with the documentation and at least try to solve.
        But this time, I will help you:

        Code:
        minutes = datetime\diff(dateEnd, dateStart, 'minutes');
        (you must have a field minutes for this formula)

        and to get the hours

        Code:
        hours = minutes/60;
        (you must have a field hours for this)

        Comment


        • Gri.N
          Gri.N commented
          Editing a comment
          Thank you !
      Working...