{"id":133,"date":"2018-02-19T05:37:38","date_gmt":"2018-02-19T05:37:38","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=133"},"modified":"2018-02-19T05:37:38","modified_gmt":"2018-02-19T05:37:38","slug":"delphi-parse-or-explode-a-string-based-on-a-parameter-field","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2018\/02\/19\/delphi-parse-or-explode-a-string-based-on-a-parameter-field\/","title":{"rendered":"Delphi : Parse or Explode a string based on a parameter field"},"content":{"rendered":"<p>this is a small code that i put together to convert the date time format of &#8220;2017-11-18 08:25&#8221; to the date time format that i am using right now which is &#8220;11\/18\/2017 8:25:00 AM&#8221;.\u00a0 For now i will make due with this one and so far it works.<\/p>\n<p>enjoy,<\/p>\n<p>coffee cup<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>var<br \/>\nvDATE : TDateTime;<br \/>\nvPOS : Integer;<br \/>\nvList : TStrings;<br \/>\nbegin<br \/>\n\/\/convert from 2017-11-18 08:25<br \/>\n\/\/convert to 11\/18\/2017 8:25:00 AM<\/p>\n<p>vPOS := POS(&#8216; &#8216;, edtDATE_ORIG.Text);<\/p>\n<p>edtDATE_CHOP.Text := Trim(Copy(edtDATE_ORIG.Text,1, vPOS));<br \/>\nedtTIME_CHOP.Text := Trim(Copy(edtDATE_ORIG.Text,vPOS + 1, 100));<\/p>\n<p>vList := TStringList.Create;<br \/>\ntry<br \/>\nExtractStrings([&#8216;-&#8216;], [], PChar(edtDATE_CHOP.Text), vList);<\/p>\n<p>edtYEAR.Text := vList.Strings[0];<br \/>\nedtMONTH.Text := vList.Strings[1];<br \/>\nedtDAY.Text := vList.Strings[2];<\/p>\n<p>\/\/year, month, day<br \/>\nedtDATE_CURR.Text := edtMONTH.Text + &#8216;\/&#8217; + edtDAY.Text + &#8216;\/&#8217; + edtYEAR.Text;<br \/>\nvDATE := StrToDateTime(edtDATE_CURR.Text + &#8216; &#8216; + edtTIME_CHOP.Text);<br \/>\nedtDATETIME.Text := DateTimeToStr(vDATE);<\/p>\n<p>finally<br \/>\nvList.Free;<br \/>\nend;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>this is a small code that i put together to convert the date time format of &#8220;2017-11-18 08:25&#8221; to the date time format that i am using right now which is &#8220;11\/18\/2017 8:25:00 AM&#8221;.\u00a0 For now i will make due with this one and so far it works. enjoy, coffee cup &nbsp; &nbsp; var vDATE &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/basicwebsitesolutions.com\/blog\/2018\/02\/19\/delphi-parse-or-explode-a-string-based-on-a-parameter-field\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Delphi : Parse or Explode a string based on a parameter field&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,2],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-day-to-day-life","category-delphi-and-interbase","category-windows-and-beyond"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":1,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}