{"id":1144234,"date":"2016-07-26T08:37:16","date_gmt":"2016-07-26T15:37:16","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/"},"modified":"2016-07-26T08:37:16","modified_gmt":"2016-07-26T15:37:16","slug":"create-event-with-date-and-time","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/","title":{"rendered":"Create Event with Date and Time"},"content":{"rendered":"<p>Hi,<\/p>\n<p>We are trying to create a front end form which allows user to create an event. It&#8217;s pulling all the data fine and creating event too but for some reason the DATE and TIME field seems to be not working. We have tried doing it via field ID but it seems to be registering date &#8220;January 1 1970&#8221; and time is always &#8220;00:00&#8221; or it takes current day as  a date and time will be always &#8220;8:00&#8221; to &#8220;5:00&#8221;<\/p>\n<p>What we want to acheive here is to create a custom query args which pushes DATE and TIME too. <\/p>\n<p>Below is the post object we&#8217;re pushing. We just need DATE and TIME selectors.<\/p>\n<p> \/\/ Create post object<br \/>\n                        $event_data = array(<br \/>\n                            &#8216;post_title&#8217;    =&gt; $event_title,<br \/>\n                            &#8216;post_content&#8217;  =&gt; $event_description,<br \/>\n                            &#8216;post_status&#8217;   =&gt; &#8216;pending&#8217;,<br \/>\n                            &#8216;EventStartDate&#8217; =&gt; $event_start_date,<br \/>\n                            &#8216;EventEndDate&#8217;   =&gt; $event_end_date,<br \/>\n                            \/\/&#8217;start_date&#8217; =&gt; $event_start_date,<br \/>\n                            \/\/&#8217;end_date&#8217; =&gt; $event_end_date,<br \/>\n                            \/\/&#8217;EventStartDate&#8217; =&gt; $event_start_date,<br \/>\n                            \/\/&#8217;EventEndDate&#8217; =&gt; $event_end_date,<br \/>\n                            \/\/&#8217;EventAllDay&#8217; =&gt; ,<br \/>\n                            \/\/&#8217;EventStartHour&#8217; =&gt; ,<br \/>\n                            \/\/&#8217;EventStartMinute&#8217; =&gt; ,<br \/>\n                            \/\/&#8217;EventEndHour&#8217; =&gt; ,<br \/>\n                            \/\/&#8217;EventEndMinute&#8217; =&gt; ,<br \/>\n                            &#8216;EventURL&#8217; =&gt; $event_website,<br \/>\n                            \/\/&#8217;EventCost&#8217; =&gt; ,<br \/>\n                            &#8216;Venue&#8217; =&gt; array(<br \/>\n                                &#8216;VenueID&#8217; =&gt; $event_venue_existing_id,<br \/>\n                                &#8216;Venue&#8217; =&gt; $venue_name,<br \/>\n                                &#8216;Address&#8217; =&gt; $event_address,<br \/>\n                                &#8216;City&#8217; =&gt; $event_city,<br \/>\n                                &#8216;Zip&#8217; =&gt; $event_postcode,<br \/>\n                            ),<br \/>\n                            &#8216;Organizer&#8217; =&gt; array(<br \/>\n                                &#8216;OrganizerID&#8217; =&gt; $event_organiser_existing_id,<br \/>\n                                &#8216;Organizer&#8217; =&gt; $event_organiser,<br \/>\n                                &#8216;Website&#8217; =&gt; $event_website,<br \/>\n                                \/\/&#8217;Phone&#8217; =&gt;,<br \/>\n                            )<br \/>\n                        );<\/p>\n<p>Any help would be much appreciated.<br \/>\nThanks,<\/p>\n","protected":false},"template":"","class_list":["post-1144234","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create Event with Date and Time -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Event with Date and Time -\" \/>\n<meta property=\"og:description\" content=\"Hi, We are trying to create a front end form which allows user to create an event. It&#8217;s pulling all the data fine and creating event too but for some reason the DATE and TIME field seems to be not working. We have tried doing it via field ID but it seems to be registering [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/\",\"name\":\"Create Event with Date and Time -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-07-26T15:37:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Create Event with Date and Time\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Event with Date and Time -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/","og_locale":"en_US","og_type":"article","og_title":"Create Event with Date and Time -","og_description":"Hi, We are trying to create a front end form which allows user to create an event. It&#8217;s pulling all the data fine and creating event too but for some reason the DATE and TIME field seems to be not working. We have tried doing it via field ID but it seems to be registering [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/","name":"Create Event with Date and Time -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-07-26T15:37:16+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/create-event-with-date-and-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Create Event with Date and Time"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1144234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1144234\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1144234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}