Php 在wordpress中返回帖子的日期数组

Php 在wordpress中返回帖子的日期数组,php,arrays,wordpress,Php,Arrays,Wordpress,我需要返回wordpress中的发布日期数组。因此,基本上如果我在wordpress中有10篇文章,我需要创建一个数组,该数组将返回10篇文章的创建日期。我不需要对列表进行排序,也不需要包含任何其他内容。很简单吧 大概是这样的: $myarray = array(); query_posts(); // The Loop while ( have_posts() ) : the_post(); $my_array = the_time('j'); endwhile; 我

我需要返回wordpress中的发布日期数组。因此,基本上如果我在wordpress中有10篇文章,我需要创建一个数组,该数组将返回10篇文章的创建日期。我不需要对列表进行排序,也不需要包含任何其他内容。很简单吧

大概是这样的:

$myarray = array();
query_posts();
// The Loop         
while ( have_posts() ) : the_post();
   $my_array = the_time('j');
endwhile;

我尝试了许多不同的方法来实现这一点,但它们或多或少都失败了。有什么想法吗

您使用的是
时间
,它不返回任何直接显示输出的内容

使用
获取时间()

while ( have_posts() ) : the_post();
   $my_array[] = get_the_time('j');
endwhile;