Skip to Content Skip to Menu

[SOLVED] today's date

7 years 5 months ago - 7 years 5 months ago #294902 by VoixTimbrees
[SOLVED] today's date was created by VoixTimbrees
Hello,
I have a question in community builder date fields,
How to set today's date , (and if possible adding 15 days to it)
see the attachment to understand better.

I need to store the acceptation date (what CBsubs doesnt, it does only for the registration date)
I think this is the easiest way to do it, I just need to grab the current date.

Jm

Attachments:
Last edit: 7 years 5 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
7 years 5 months ago #294912 by krileon
Replied by krileon on topic today's date
There is no functionality for what you're trying to do in CBSubs Fields. CB Auto Actions can do this using its Format Functions, which will run your supplied values through PHP functions to accomplish what you're wanting. Your alternative is to use CBSubs SQL Actions and do that using SQL functions. Example as follows.

Code:
UPDATE `#__comprofiler` SET `cb_acceptation` = DATE_ADD( NOW(), INTERVAL 15 DAY ) WHERE `id` = '[user_id]'

See MYSQL documentation below for further usage information.

dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#function_date-add


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

7 years 5 months ago #294918 by VoixTimbrees
Replied by VoixTimbrees on topic today's date
Thank you sooooo much,
I did not even need to change a letter of your script ;)
And I am glad to see an exemple of sql request from there,
have a nice week end!
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum