{"id":371,"date":"2020-08-19T01:06:00","date_gmt":"2020-08-19T05:06:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=371"},"modified":"2020-12-24T01:08:46","modified_gmt":"2020-12-24T06:08:46","slug":"php-converting-to-epoch-time-and-human-readable-time","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/php-converting-to-epoch-time-and-human-readable-time\/","title":{"rendered":"PHP: Converting to epoch time and human readable time"},"content":{"rendered":"\n<p>Epoch time is Unix timestamp which counts the number of seconds since January 1 1970 00:00:00 UTC. Without getting into long discussion, follow is how your convert between human readable date and epoch time.<\/p>\n\n\n\n<p><strong>Convert Human Readable Date to Epoch Time<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$now = strtotime('2010-04-25');\nprint $now;<\/code><\/pre>\n\n\n\n<p><strong>Convert Epoch Time to Human Readable Time<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$human_date=date(\"Y-m-d\", 1251627495);\nprint human_date;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Epoch time is Unix timestamp which counts the number of seconds since January 1 1970 00:00:00 UTC. Without getting into long discussion, follow is how your convert between human readable date and epoch time. Convert Human Readable Date to Epoch Time Convert Epoch Time to Human Readable Time<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[24],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/371\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}