{"id":2247,"date":"2012-06-18T09:02:46","date_gmt":"2012-06-18T07:02:46","guid":{"rendered":"http:\/\/blog.unelink.es\/?p=2247"},"modified":"2012-06-14T10:57:43","modified_gmt":"2012-06-14T08:57:43","slug":"timestamp-en-linux-bash","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/timestamp-en-linux-bash\/","title":{"rendered":"Timestamp en Linux Bash"},"content":{"rendered":"<p>Utilizando el comando \"date\" podemos obtener el timestamp Unix de la siguiente manera:<\/p>\n<pre>\r\ndate +%s\r\n<\/pre>\n<p>Con este dato y el comando \"bc\" (la calculadora de la consola), podemos obtener timestamp concretos:<\/p>\n<pre>\r\nFINAL=`date +%s`             #:----> AHORA\r\nINICIO=`echo $END-3600|bc`   #:----> HACE 1 HORA\r\n\r\necho $INICIO\r\necho $FINAL\r\n\r\nFINAL=`date +%s`             #:----> AHORA\r\nINICIO=`echo $END-86400|bc`  #:----> AYER A ESTA MISMA HORA - HACE 1 DIA\r\n\r\necho $INICIO\r\necho $FINAL\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Utilizando el comando \"date\" podemos obtener el timestamp Unix de la siguiente manera: date +%s Con este dato y el comando \"bc\" (la calculadora de la consola), podemos obtener timestamp concretos: FINAL=`date +%s` #:----> AHORA INICIO=`echo $END-3600|bc` #:----> HACE 1 HORA echo $INICIO echo $FINAL FINAL=`date +%s` #:----> AHORA INICIO=`echo $END-86400|bc` #:----> AYER A ESTA MISMA HORA - HACE 1&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/timestamp-en-linux-bash\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,6],"tags":[152,161,216,160],"class_list":["post-2247","post","type-post","status-publish","format-standard","hentry","category-linux","category-wiki","tag-bash","tag-date","tag-linux","tag-timestamp","cat-10-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=2247"}],"version-history":[{"count":3,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2247\/revisions"}],"predecessor-version":[{"id":2333,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2247\/revisions\/2333"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=2247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=2247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=2247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}