-
- 247 Posts
I’ve got an issue with formatting the date
When I use getResource to pull a template with
[[+tv.ivegotadate:date=`%Y\%m\%d`]]
I get this date: 1969\12\31
but when I use [[+tv.ivegotadate]], I get the right date.
When I had[[*ivegotadate:date=`%Y\%m\%d`]] I got no data.
I had set the date format through the output type:date, setting the output type to default fixed it for [[* but not for [[+tv.
I would have thought that the output type and format would set the default format, not send as string.
But it looks like getResource is not passing it correctly. Any idea why this might be?
-
- 24,544 Posts
Quote from: daspoda at Sep 22, 2010, 01:42 AM
I’ve got an issue with formatting the date
When I use getResource to pull a template with
[[+tv.ivegotadate:date=`%Y\%m\%d`]]
Try:
[[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]
-
- 275 Posts
Quote from: BobRay at Sep 22, 2010, 03:00 AMQuote from: daspoda at Sep 22, 2010, 01:42 AM
I've got an issue with formatting the date
When I use getResource to pull a template with
[[+tv.ivegotadate:date=`%Y\%m\%d`]]
Try:
[[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]
An answer from two years ago just made my day!
Absolutely brilliant...
MODx Revolution / MAMP / OS X
-
- 24,544 Posts
Glad I could help.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
-
- 173 Posts
Quote from: skndn60 at Oct 04, 2012, 04:50 PMQuote from: BobRay at Sep 22, 2010, 03:00 AMQuote from: daspoda at Sep 22, 2010, 01:42 AM
I've got an issue with formatting the date
When I use getResource to pull a template with
[[+tv.ivegotadate:date=`%Y\%m\%d`]]
Try:
[[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]
An answer from two years ago just made my day!
Absolutely brilliant...
3 Years and 1 month later and it still works. Isn't the internet great!
Everything I know I learned on the internet. Saved me thousands in College tuition,