Jump to content

nipo

New Members
  • Posts

    4
  • Joined

  • Last visited

nipo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Perhaps , but perhaps the last counting to be understood not as a time or date , but as simply data, which for months has a limit of 12, and for days 30.Perhaps
  2. I have a first field on form with job beginning in date format d-m-Y (27-03-1997 for example).Second calc field is with code and can calculate a length of sevice from beginning (27-03-1997) until today.Calc field show me result in Y-m-d format(19-03-29) and work fine.Here is the code: $start_date = '{yourtable___yourdate}'; if (!empty($start_date)) { $now_date = new DateTime(); $start_date = new DateTime($start_date); $since_start = $start_date->diff($now_date); return $since_start->format('%y-%m-%d'); } else { return "no data"; } Now, I have another length of service (03-08-02 for example) in same form, which is done before 1997. ,and wrote in simple third field in text format(Y-m-d). I want in fourth calc field on form get the summ of those two length of service. Exactly : 24-00-01 must be result (19-03-29 + 03-08-02).One month is 30 days.Form is on Joomla 2.5 , made with form builder. Thanks for help!
  3. Is anybody at homeeeee
  4. Hi ! I have a litle problem. I have on my form four field. In first I have a birthdays in format d-m-Y(12-03-1994). Second field calculatig age from birthday until now ,formated Y-m-d (29-04-10 for example), and have a code : $start_date = '{yourtable___yourdate}'; if (!empty($start_date)) { $now_date = new DateTime(); $start_date = new DateTime($start_date); $since_start = $start_date->diff($now_date); return $since_start->format('%y-%m-%d'); } else { return "no data"; } and work fine . PROBLEM IS : In third field have another age in format Y-m-d for example 13-05-16 , and want summ with second field. (29-04-10 + 13-05-16 = 42-09-26) The summ of calculating 42-09-26 (Y-m-d) must be displayed in fourth field ,but how.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.