CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Pledge start_date 0 when using the API
Pages: [1]

Author Topic: Pledge start_date 0 when using the API  (Read 414 times)

crschalper

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.7.8
  • CMS version: Wordpress 4.7.1
  • MySQL version: 2.2
  • PHP version: 2.2
Pledge start_date 0 when using the API
August 21, 2015, 08:39:57 am
Hey everyone!

I'm using the API to create a Pledge, and I'm getting always 0 on the start_date.

Here (https://forum.civicrm.org/index.php?topic=4104.0) it says that the format should be The proper format is YYYYMMDD or YYYYMMDDhhmmss, but I can't get it to work. I'm using CiviCRM 4.5.4.

I've tried:
$start_date = date("Ymd",strtotime('now'))

$ts = time();
$date = new DateTime(date("YmdHis", $ts));


How should it be??
Thanks!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Pledge start_date 0 when using the API
August 21, 2015, 11:33:26 am
With few exceptions the api passes dates through strtotime, so you ought to be able to specify 'start_date' => 'now'
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Pledge start_date 0 when using the API

This forum was archived on 2017-11-26.