# pdoResources and publishedon Date Formatting

**URL:** <https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060>\
**Category:** General\
**Created:** [December 28, 2019, 10:47pm UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060 "2019-12-28T22:47:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShatteredSite](https://community.modx.com/user_avatar/community.modx.com/shatteredsite/32/677_2.png) [@ShatteredSite](https://community.modx.com/u/ShatteredSite)\
**Post date:** [December 28, 2019, 10:47pm UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/1 "2019-12-28T22:47:52Z")

</div>

I am switching from getResources to pdoResources and trying to get the `[[+publishedon]]` tag to output a properly formatted date. However, since `[[+publishedon:strtotime:date=`%Y-%m-%d`]]` does not return anything, I am unsure how to replicate the same output I would get in getResources. I saw in a post saying it does not generate a string and thus `strtotime` would not work, but no solution was stated.

Thanks!

---

<div class="post-metadata">

**Author:** ![9thwave](https://community.modx.com/user_avatar/community.modx.com/9thwave/32/221_2.png) [@9thwave](https://community.modx.com/u/9thwave)\
**Post date:** [December 29, 2019, 6:42am UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/2 "2019-12-29T06:42:34Z")

</div>

Could you post your full chunk/snippet code?  
Have you tried…  
[[+publishedon:date=`%Y-%m-%d `]]

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [December 30, 2019, 6:52am UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/3 "2019-12-30T06:52:52Z")

</div>

> [@ShatteredSite](#):
>
> `[[+publishedon:strtotime:date=` %Y-%m-%d `]]`

> [@pdoResources and publishedon Date Formatting](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/3):
>
> [https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/3](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/3) pdoResources won’t recognize that as a publishedon tag. It may pass the tag back, but it won’t contain the date/time. Here’s something else to try: [[[[+publishedon]]:strtotime:date=`%Y-%m-%d`]] In theory, pdoResources will replace the publishedon tag, and MODX will handle the output modifier after the time is there. I could be wrong.

pdoResources won’t recognize that as a publishedon tag. It may pass the tag back, but it won’t contain the date/time.

Here’s something else to try:

```auto
[[[[+publishedon]]:strtotime:date=`%Y-%m-%d`]]

```

In theory, pdoResources will replace the publishedon tag, and MODX will handle the output modifier after the time is there. I could be wrong.

---

<div class="post-metadata">

**Author:** ![lucy](https://community.modx.com/user_avatar/community.modx.com/lucy/32/43_2.png) [@lucy](https://community.modx.com/u/lucy)\
**Post date:** [December 30, 2019, 7:47pm UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/4 "2019-12-30T19:47:39Z")

</div>

PdoTools doesn’t convert dates to strings, so you don’t need to use strtotime. Any date tag you have used with getResources _should_ work with pdoResources simply by removing strtotime.  
[https://forums.modx.com/thread/101846/pdotools---pdopage-pdoresources-publishedon-createdon-dates-not-displaying-with-formatting](https://forums.modx.com/thread/101846/pdotools---pdopage-pdoresources-publishedon-createdon-dates-not-displaying-with-formatting)

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [December 30, 2019, 8:33pm UTC](https://community.modx.com/t/pdoresources-and-publishedon-date-formatting/2060/5 "2019-12-30T20:33:46Z")

</div>

> [@lucy](#):
>
> PdoTools doesn’t convert dates to strings, so you don’t need to use strtotime. Any date tag you have used with getResources _should_ work with pdoResources simply by removing strtotime.

Thanks – I did not know that.
