Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0.6 - Twig |date('U') returns nothing #2867

Closed
thisanimus opened this issue May 9, 2018 · 1 comment
Closed

v3.0.6 - Twig |date('U') returns nothing #2867

thisanimus opened this issue May 9, 2018 · 1 comment

Comments

@thisanimus
Copy link

thisanimus commented May 9, 2018

Description

Attempt to display a datetime value in UNIX timecode format using the twig |date() filter

Steps to reproduce

  1. Put {{ entry.postDate|date('U') }} in a template file.
  2. Notice that this returns nothing.

Additional info

  • Craft version: 3.0.6
  • PHP version: 7.0.30
  • Database driver & version: MySQL 5.6.38
@brandonkelly
Copy link
Member

Just fixed this for the next release, but in the meantime you can just change |date('U') to .timestamp.

{{ entry.postDate.timestamp }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants