{"result":{"depiction_url":null,"edges":{"hasreference":{"objects":[{"created":"2026-10-07T11:13:39Z","object_id":{"id":1419,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_forms_and_validation","title":{"_type":"trans","tr":{"en":"Validate a form on both sides"}},"uri":"https:\/\/zotonic.com\/id\/1419"},"seq":1},{"created":"2026-10-07T11:13:39Z","object_id":{"id":2951,"is_a":["text","documentation","developerguide"],"name":"developer_resource_properties","title":{"_type":"trans","tr":{"en":"Read and update resource properties"}},"uri":"https:\/\/zotonic.com\/id\/2951"},"seq":2}],"predicate":{"id":2774,"is_a":["meta","predicate"],"name":"hasreference","title":{"_type":"trans","tr":{"en":"Documentation reference"}},"uri":"https:\/\/zotonic.com\/id\/hasreference"}},"references":{"objects":[{"created":"2020-05-30T05:47:25Z","object_id":{"id":1279,"is_a":["text","documentation"],"name":"doc_glossary","title":"Glossary","uri":"https:\/\/zotonic.com\/id\/1279"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"subject":{"objects":[{"created":"2026-09-15T13:43:18Z","object_id":{"id":2557,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_cookbook_recipe","title":"Cookbook recipe","uri":"https:\/\/zotonic.com\/id\/2557"},"seq":1},{"created":"2026-09-15T13:43:23Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-10-07T11:13:39Z","object_id":{"id":2614,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_resource","title":"Resource","uri":"https:\/\/zotonic.com\/id\/2614"},"seq":3},{"created":"2026-09-15T13:44:10Z","object_id":{"id":2662,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_date_and_time","title":"Date and time","uri":"https:\/\/zotonic.com\/id\/2662"},"seq":4},{"created":"2026-09-15T13:43:30Z","object_id":{"id":2612,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_data_processing_and_formatting","title":"Data processing and formatting","uri":"https:\/\/zotonic.com\/id\/2612"},"seq":5},{"created":"2026-09-15T13:44:21Z","object_id":{"id":2638,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_edit","title":"Edit","uri":"https:\/\/zotonic.com\/id\/2638"},"seq":6},{"created":"2026-09-15T13:45:20Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":7},{"created":"2026-09-15T13:45:48Z","object_id":{"id":2620,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_template","title":"Template","uri":"https:\/\/zotonic.com\/id\/2620"},"seq":8},{"created":"2026-09-15T13:45:57Z","object_id":{"id":2582,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_forms","title":"Forms","uri":"https:\/\/zotonic.com\/id\/2582"},"seq":9},{"created":"2026-09-15T13:46:34Z","object_id":{"id":2672,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_html","title":"HTML","uri":"https:\/\/zotonic.com\/id\/2672"},"seq":10}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":1553,"is_a":["text","documentation","cookbook"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1553"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_cookbook_admin_datetime","page_url":{"en":"https:\/\/zotonic.com\/cookbook\/1553\/save-date-and-time-form-fields","x-default":"https:\/\/zotonic.com\/cookbook\/1553\/save-date-and-time-form-fields"},"preview_url":null,"resource":{"body":{"_type":"trans","tr":{"en":"<p>Zotonic can combine date and time form fields when converting a <strong>list of key\/value pairs<\/strong> into resource properties. For example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">Props = [{&lt;&lt;&quot;dt:ymd:0:date_end&quot;&gt;&gt;, &lt;&lt;&quot;2026-10-07&quot;&gt;&gt;}],\nm_rsc:update(ResourceId, Props, Context).\n<\/code><\/pre>\n<p>The <code>dt:<\/code> prefix invokes date recombination; <code>ymd<\/code> identifies the date parts and <code>date_end<\/code> is the destination property. The <code>0<\/code> default supplies the start of the day; <code>1<\/code> supplies the end of the day when time parts are absent. Include the corresponding time field when the user chooses a specific time.<\/p>\n<p>Use the current admin date\/time templates as examples, and keep the selected timezone explicit. Test a date-only value, a date with time, an empty value and a daylight-saving boundary. Do not replace this form list with a map and expect the special field names to be recombined: direct maps should contain the final property value instead.<\/p>\n<p>In a custom event handler, verify resource-edit permission, validate the submitted date and handle both <code>{ok, Id}<\/code> and <code>{error, Reason}<\/code> from the update. Reload or show success only after the update succeeds.<\/p>"}},"category_id":{"id":318,"is_a":["meta","category"],"name":"cookbook","title":{"_type":"trans","tr":{"en":"Cookbook"}},"uri":"https:\/\/test.zotonic.com\/id\/318"},"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"created":"2020-05-30T05:47:25Z","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"doc_editorial_bundle":true,"doc_editorial_edges":{"hasreference":[1419,2951],"subject":[2614]},"github_url":"https:\/\/github.com\/zotonic\/zotonic\/tree\/master\/doc\/cookbook\/admin-datetime.rst","is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2026-10-07T11:13:47Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"name":"doc_cookbook_admin_datetime","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2022-02-15T10:01:19Z","slug":"save-date-and-time-form-fields","summary":{"_type":"trans","tr":{"en":"Use the form parser deliberately and distinguish it from direct property updates."}},"title":{"_type":"trans","tr":{"en":"Save date and time form fields"}},"title_slug":{"_type":"trans","tr":{"en":"save-date-and-time-form-fields"}},"tz":"UTC","uri":null,"version":35,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/1553","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1553"}},"status":"ok"}