Title: [Plugin: Advanced Custom Fields] Date Time Picker
Last modified: August 20, 2016

---

# [Plugin: Advanced Custom Fields] Date Time Picker

 *  [Omi](https://wordpress.org/support/users/dekzgimutao/)
 * (@dekzgimutao)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/)
 * This is very useful plugin by the way, Can i ask if is there an easy way to add
   timepicker or simple do both datetimepicker in a fields thanks this is the only
   thing missing for my project thanks,
 * [http://wordpress.org/extend/plugins/advanced-custom-fields/](http://wordpress.org/extend/plugins/advanced-custom-fields/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [jhpf](https://wordpress.org/support/users/jhpf/)
 * (@jhpf)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389685)
 * I found this [http://trentrichardson.com/examples/timepicker/](http://trentrichardson.com/examples/timepicker/)
   which should do the job but I’ve had no luck integrating it into /core/fields/
   date_picker/date_picker.php
 * Any help would be great.
 *  [xanderashwell](https://wordpress.org/support/users/xanderashwell/)
 * (@xanderashwell)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389771)
 * Elliot has a `register_field` function now which is great for extending ACF:
   
   [Creating and registering your own field](http://www.advancedcustomfields.com/docs/tutorials/creating-and-registering-your-own-field/)
 * I’ve used the timepicker extension above, and Elliot’s own datepicker field, 
   to create a time field.
 * Download [these files](http://dl.dropbox.com/u/1752812/custom-fields.zip), unzip
   and install in your theme directory.
 * Add the following code to your functions.php file:
    `register_field('xa_time_field',
   dirname(__FILE__) . '/custom-fields/timepicker/time_picker.php');`
 * (amend the appended URL as you wish, if necessary)
 * You should now have a “Time” field type in Advanced Custom Fields!
 * Around about line 158 in `time_picker.php` is where you can alter whether the
   JS displays datetimepicker or just timepicker.
 * You might want to play around with `data_date-format`,`data_time-format` and 
   the [format of the date string](http://php.net/manual/en/function.date.php) to
   get the output you desire.
 * Hope that helps.
 *  [Geet Jacobs](https://wordpress.org/support/users/geetjacobs/)
 * (@geetjacobs)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389772)
 * xanderashwell, very cool was just looking to solve this!
 * I think the zip file on dropbox is corrupt, least from the 3 unzip programs I
   tried. Might try to write my own files but seemed to perfect that you just adding
   this 1 hour ago!
 * Thank you
 *  [xanderashwell](https://wordpress.org/support/users/xanderashwell/)
 * (@xanderashwell)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389773)
 * Hi Geet,
 * Try again, the zip file was corrupt at my end as well – I’ll also stick a copy
   up on github when I get a chance.
 *  [bisrandom](https://wordpress.org/support/users/bisrandom/)
 * (@bisrandom)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389775)
 * Hi Xanderashwell,
 * This is exactly what I’ve been looking for .. but I’m just having some trouble
   implementing it ….. I’ve copied the files over .. checked the url is correct …
   added the register field to my functions.php
 * The ‘Time’ field becomes available, however it just doesn’t seem to function 
   correctly. It doesn’t bring up a selector … just allows me to type in the custom
   field box.
 * to try to figure out what I was doing wrong I edited the time_picker.php file
   and on line 158 I changed it to datepicker .. to test if that would work and 
   it was fine (the date selector displayed as expected) … I just can’t get timepicker
   or datetimepicker working.
 * eg.
    input.addClass(‘active’).datepicker({
 * Any ideas? Many thanks!
 *  [daveleeone](https://wordpress.org/support/users/daveleeone/)
 * (@daveleeone)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389776)
 * thanks [@xanderashwell](https://wordpress.org/support/users/xanderashwell/) for
   posting your code. It works very well 🙂
 *  [bisrandom](https://wordpress.org/support/users/bisrandom/)
 * (@bisrandom)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389777)
 * Hi daveleeone,
 * Can I please ask what you changed line 158 to ?
 * I’ve tried both:
    input.addClass(‘active’).timepicker({ and input.addClass(‘active’).
   datetimepicker({
 * but can’t get it to work … if I change it back to datepicker it works fine …
 * Cheers

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Advanced Custom Fields] Date Time Picker’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

 * 7 replies
 * 6 participants
 * Last reply from: [bisrandom](https://wordpress.org/support/users/bisrandom/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-date-time-picker/#post-2389777)
 * Status: not resolved