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

  1. phase00
    Posted 3 years 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


  2. elliotcondon
    Plugin Author

    Posted 3 years 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
    Posted 3 years 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

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.