ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

What Date Format do I use in a conditional variable?

June 26, 2007 11:48am

Subscribe [3]
  • #1 / Jun 26, 2007 11:48am

    Ceil

    65 posts

    I want to create a page containing a query that has:

    {if expiration_date="x"}

    content

    {/if}

    where “x” is the a particular expiration date.

    The problem is, I don’t know how to enter the date. I have run queries that display dates on a page without assigning any particular formatting (i.e., I did not include format=”%M %d” or anything like that), and I do see this long string of numbers, but I do not know what the numbers in the string represent or what order they appear in.

    Would someone please tell me how to “call” the date I want by sharing the numeric string I need to enter for the month, day, year, and time?

    If you send me a string, please tell me which digits represent what.

    Thank you so much for your help!

    Best wishes,
    Ceil

  • #2 / Jun 26, 2007 12:25pm

    silenz

    1651 posts

    That long string is actually a Unix timestamp. It represents the number of seconds that have passed between the Unix Epoch (January 1, 1970 00:00:00 GMT) and the time specified.

    I don’t think this will help you ...

    But amazingly you can actually do a conditional check using the date formatting like

    {if "{expiration_date format="%Y-%m-%d"}" == "2007-12-01"}
    
    content
    
    {/if}
  • #3 / Jun 26, 2007 2:42pm

    Ceil

    65 posts

    Wow! This is EXACTLY what I was looking for!

    THANK YOU SO MUCH!!!

    Best wishes,
    Ceil

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases