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.

Date Fieldtype Custom Field Unix Timestamp to normal date?

November 10, 2014 1:47am

Subscribe [2]
  • #1 / Nov 10, 2014 1:47am

    bmovie

    619 posts

    I create a custom field with a date fieldtype, I display in channel entries but show the unix time stamp 1415595780, how can cover to normal date…????

    I cant find anything in the docs about date fieldtype.

    help! plz

  • #2 / Nov 10, 2014 7:34am

    Boyink!

    5011 posts

  • #3 / Nov 10, 2014 7:35am

    Boyink!

    5011 posts

  • #4 / Nov 10, 2014 1:02pm

    bmovie

    619 posts

    https://ellislab.com/expressionengine/user-guide/templates/date_variable_formatting.html

    thank you Boyink, but that dont say anything to me…
    again, I create a field with date fieldtype, if is print that custom field show me a UNIX timestamp, I dont see how render in a proper way… 11/23/2014 10:23PM you know…
    I dont see anything in the docs about it, that link that you show me dont say anything about “date fieldtype”

    any help? thank you

  • #5 / Nov 10, 2014 1:10pm

    Boyink!

    5011 posts

    You have to use a formatting code, just like any non-custom date field.

  • #6 / Nov 10, 2014 1:27pm

    bmovie

    619 posts

    You have to use a formatting code, just like any non-custom date field.

    formatting code?
    so I can’t use date fieldtype in a custom field? if not why exist?
    I dont get the point…

    I was thing something like this:

    DATE(cf_fecha), so that renders the normal date, not a timestamp… but I cant find any in the docs.

  • #7 / Nov 10, 2014 1:36pm

    Boyink!

    5011 posts

    I guess I don’t understand your confusion. To use any date field in EE - whether you have created it or not - you have to use a formatting code. The formatting code just changes the display of the UNIX time stamp to a format of your choosing.

    {custom_field format="format codes here"}
  • #8 / Nov 10, 2014 2:14pm

    bmovie

    619 posts

    I guess I don’t understand your confusion. To use any date field in EE - whether you have created it or not - you have to use a formatting code. The formatting code just changes the display of the UNIX time stamp to a format of your choosing.

    {custom_field format="format codes here"}

    thank you now works:

    {cf_agenda_fecha format="%F %d %Y"}

    but in any section of the docs say that, about custom fields + date…

    and one more thing related please:

    I need show entries ONLY if are created today

    something like:

    {if cf_agenda_fecha format="%F %d %Y" == current_time format="%F %d %Y"}
       <span class="label label-warning">Today</span>
    {/if}

    any help? thanks again

     

  • #9 / Nov 10, 2014 6:18pm

    Boyink!

    5011 posts

    You would need that logic in the channel:entries tag, not at the custom tag level.

  • #10 / Nov 10, 2014 6:35pm

    bmovie

    619 posts

    You would need that logic in the channel:entries tag, not at the custom tag level.

    thank you, well I resolve with STASH variables, I put in one variable the current time and the entry date… and I comapre both == if match show the html tag.
    works

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

ExpressionEngine News!

#eecms, #events, #releases