WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] Bug with Date Picker save format @ (3 posts)

  1. phase00
    Member
    Posted 1 year ago #

    Hi there,

    I haven't looked in to your code, so I can't comment at which line the error is occurring, but I just made a custom post type with a date picker that saves to the database in UNIX timestamp '@'.

    When I do a simple $date = get_field('date'); echo $date It is returning too many 0's.

    For example, Wed, 22 Aug 2012 07:00:00 GMT returns 1345618800000 when saved via @ which is three too many 0's

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi phase00,

    Yes, for some reason jQuery through it would be a good idea to save unix in ms..

    You can read about a solution here http://stackoverflow.com/questions/11062314/jquery-ui-convert-jquery-ui-datepicker-to-unix-time

    or just save the format in "yymmdd"

  3. phase00
    Member
    Posted 1 year ago #

    Oh, that's very odd. Didn't look in to it more than seeing it spit out too many zeros. Thought I'd bring it up. Nice catch. I save it in yymmdd then use date('', strtottime($var)) anyways :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.