{"id":1049,"date":"2023-01-16T16:49:36","date_gmt":"2023-01-16T21:49:36","guid":{"rendered":"https:\/\/carloscarvajal.co\/?p=1049"},"modified":"2023-01-24T23:21:39","modified_gmt":"2023-01-25T04:21:39","slug":"formatear-fecha-am-pm-javascript","status":"publish","type":"post","link":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/","title":{"rendered":"Formatear fecha AM\/PM en Javascript"},"content":{"rendered":"\n

Modificar la hora para poder cambiar de HRS a AM\/PM como por ejemplo 17:15hrs a 5:15 p.m. o 5:30hrs a 5:30 a.m., por lo general para centro y sur am\u00e9rica.<\/p>\n\n\n\n

function formatAMPM(date) {\n  var hours = date.getHours(),\n  minutes = date.getMinutes(),\n  ampm = hours >= 12 ? 'p.m.' : 'a.m.';\n  hours = hours % 12;\n  hours = hours ? hours : 12;\n  minutes = minutes < 10 ? '0'+minutes : minutes;\n  var strTime = hours + ':' + minutes + ' ' + ampm;\n  return strTime;\n};<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

Modificar la hora para poder cambiar de HRS a AM\/PM como por ejemplo 17:15hrs a 5:15 p.m. o 5:30hrs a 5:30 a.m., por lo general para centro y sur am\u00e9rica.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[52],"tags":[43,42],"class_list":["post-1049","post","type-post","status-publish","format-standard","hentry","category-desarrollo-web","tag-date","tag-javascript"],"yoast_head":"\nFormatear fecha AM\/PM en Javascript - Carlos Carvajal<\/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:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Formatear fecha AM\/PM en Javascript - Carlos Carvajal\" \/>\n<meta property=\"og:description\" content=\"Modificar la hora para poder cambiar de HRS a AM\/PM como por ejemplo 17:15hrs a 5:15 p.m. o 5:30hrs a 5:30 a.m., por lo general para centro y sur am\u00e9rica.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Carlos Carvajal\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-16T21:49:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-25T04:21:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2017\/06\/bg-skills.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Carlos Carvajal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cardex107\" \/>\n<meta name=\"twitter:site\" content=\"@cardex107\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carlos Carvajal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo estimado de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\"},\"author\":{\"name\":\"Carlos Carvajal\",\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0\"},\"headline\":\"Formatear fecha AM\/PM en Javascript\",\"datePublished\":\"2023-01-16T21:49:36+00:00\",\"dateModified\":\"2023-01-25T04:21:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\"},\"wordCount\":38,\"publisher\":{\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0\"},\"keywords\":[\"date\",\"javascript\"],\"articleSection\":[\"Desarrollo Web\"],\"inLanguage\":\"es-CO\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\",\"url\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\",\"name\":\"Formatear fecha AM\/PM en Javascript - Carlos Carvajal\",\"isPartOf\":{\"@id\":\"https:\/\/carloscarvajal.co\/#website\"},\"datePublished\":\"2023-01-16T21:49:36+00:00\",\"dateModified\":\"2023-01-25T04:21:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#breadcrumb\"},\"inLanguage\":\"es-CO\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/carloscarvajal.co\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Formatear fecha AM\/PM en Javascript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/carloscarvajal.co\/#website\",\"url\":\"https:\/\/carloscarvajal.co\/\",\"name\":\"Carlos Carvajal\",\"description\":\"Dise\u00f1o y desarrollo digital - Web - Apps\",\"publisher\":{\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/carloscarvajal.co\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es-CO\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0\",\"name\":\"Carlos Carvajal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es-CO\",\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2023\/01\/WP-Profile-low.jpg\",\"contentUrl\":\"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2023\/01\/WP-Profile-low.jpg\",\"width\":512,\"height\":512,\"caption\":\"Carlos Carvajal\"},\"logo\":{\"@id\":\"https:\/\/carloscarvajal.co\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Formatear fecha AM\/PM en Javascript - Carlos Carvajal","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:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/","og_locale":"es_ES","og_type":"article","og_title":"Formatear fecha AM\/PM en Javascript - Carlos Carvajal","og_description":"Modificar la hora para poder cambiar de HRS a AM\/PM como por ejemplo 17:15hrs a 5:15 p.m. o 5:30hrs a 5:30 a.m., por lo general para centro y sur am\u00e9rica.","og_url":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/","og_site_name":"Carlos Carvajal","article_published_time":"2023-01-16T21:49:36+00:00","article_modified_time":"2023-01-25T04:21:39+00:00","og_image":[{"width":1600,"height":1200,"url":"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2017\/06\/bg-skills.jpg","type":"image\/jpeg"}],"author":"Carlos Carvajal","twitter_card":"summary_large_image","twitter_creator":"@cardex107","twitter_site":"@cardex107","twitter_misc":{"Escrito por":"Carlos Carvajal","Tiempo estimado de lectura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#article","isPartOf":{"@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/"},"author":{"name":"Carlos Carvajal","@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0"},"headline":"Formatear fecha AM\/PM en Javascript","datePublished":"2023-01-16T21:49:36+00:00","dateModified":"2023-01-25T04:21:39+00:00","mainEntityOfPage":{"@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/"},"wordCount":38,"publisher":{"@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0"},"keywords":["date","javascript"],"articleSection":["Desarrollo Web"],"inLanguage":"es-CO"},{"@type":"WebPage","@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/","url":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/","name":"Formatear fecha AM\/PM en Javascript - Carlos Carvajal","isPartOf":{"@id":"https:\/\/carloscarvajal.co\/#website"},"datePublished":"2023-01-16T21:49:36+00:00","dateModified":"2023-01-25T04:21:39+00:00","breadcrumb":{"@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#breadcrumb"},"inLanguage":"es-CO","potentialAction":[{"@type":"ReadAction","target":["https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/carloscarvajal.co\/formatear-fecha-am-pm-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/carloscarvajal.co\/"},{"@type":"ListItem","position":2,"name":"Formatear fecha AM\/PM en Javascript"}]},{"@type":"WebSite","@id":"https:\/\/carloscarvajal.co\/#website","url":"https:\/\/carloscarvajal.co\/","name":"Carlos Carvajal","description":"Dise\u00f1o y desarrollo digital - Web - Apps","publisher":{"@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/carloscarvajal.co\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es-CO"},{"@type":["Person","Organization"],"@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/d20e7ea00ef1f9d99d8724f702de01f0","name":"Carlos Carvajal","image":{"@type":"ImageObject","inLanguage":"es-CO","@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/image\/","url":"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2023\/01\/WP-Profile-low.jpg","contentUrl":"https:\/\/carloscarvajal.co\/wp-content\/uploads\/2023\/01\/WP-Profile-low.jpg","width":512,"height":512,"caption":"Carlos Carvajal"},"logo":{"@id":"https:\/\/carloscarvajal.co\/#\/schema\/person\/image\/"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Carlos Carvajal","author_link":"https:\/\/carloscarvajal.co\/author\/cardex107\/"},"uagb_comment_info":0,"uagb_excerpt":"Modificar la hora para poder cambiar de HRS a AM\/PM como por ejemplo 17:15hrs a 5:15 p.m. o 5:30hrs a 5:30 a.m., por lo general para centro y sur am\u00e9rica.","_links":{"self":[{"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/posts\/1049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":2,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":1359,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/posts\/1049\/revisions\/1359"}],"wp:attachment":[{"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carloscarvajal.co\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}