• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Adding a number of days to the current date

Adding a number of days to the current date 3 years 6 months ago #40619

  • info4060
  • info4060's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Hi Supportteam,

I am unable to generate an end date according to the manual. (www.rsjoomla.com/support/documentation/r.../date-operation.html)
The difference is that I have 2 date fields and that I have to indicate the correct one.

The script I made now does something, but it doesn't give an end date just a big number.

In my PDF it shows now: From 10-10-2020 to 1602280806
But I don't know how to get this number 1602280806 into a date.

My script looks like this:
$_POST['form']['enddate'] = date(strtotime($_POST['form']['startdate']) + ($_POST['form']['daysvalid'].'days'));

enddate = the field with the wanted end date
startdate = the Calendar field generated by customer in form with a pop-up
daysvalid = is a hidden field with the number of days that a permit is valid

Also this code doesn't work:
$_POST['form']['enddate'] =  date('m-d-Y',strtotime($_POST['form']['startdate'].' +6 days'));

Hope you can give me a hint.

Kind regards,
Lumiga
Last Edit: 3 years 6 months ago by info4060.
The administrator has disabled public write access.

Adding a number of days to the current date 3 years 6 months ago #40622

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

You could try adding the format for the date() function, for example:
$_POST['form']['enddate'] = date('m/d/Y',strtotime($_POST['form']['startdate'].' +'.$_POST['form']['daysvalid'].' days'));

I tested this format and it worked correctly.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 3 years 6 months ago by andreic.
The administrator has disabled public write access.
The following user(s) said Thank You: info4060

Adding a number of days to the current date 3 years 6 months ago #40625

  • info4060
  • info4060's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Hi Andreic,

Thank you very much!!!

I am very happy with this and you made my day :)

Kind regards,
Lumiga
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!