Catalog BE and FE timestamp bug
There is a bug in catalog, cause I don't find any other explanation.
Example:
Member add his item via FE. I have field "item was created: "datecreated via BE date and in database type="timestamp"".
Now if user repair his item via FE everything works fine. But If I via BE add a picture of user timestamp change to strange date (40years back).
Ok maybe I didn't done this right somewhere in DB but....When i define timestamp in DB, and repair some item in backend the "item was created" field in DB changes to VARCHAR?
Today the field (in BE type=file (image)) changed to timestamp?
I just can't done this that everyday the timestamp isn't changed to VARCHAR.
If there is another solution how to make "date created", please help (I've tryed {{last_update}} but this was working only few days)...
Another strange thing....
If I define in BE where I have "date created" field -> Enable additional format function, it converts to VARCHAR again.
Re: Catalog BE and FE timestamp bug
The catalog already includes a field called tstamp by default. It updates when you save an entry, so not sure why you adding this field twice...
Re: Catalog BE and FE timestamp bug
In the beginning I didn't saw tstamp, tnx for notice.
Now I made like that
Code:
<?php echo date("d.m.Y", strtotime($entry['data']['tstamp']['value'])); ?>
But it returns me on every added item date: 01.01.1970
I only need to display date when the item was added, nothing else.
Help, please.
Re: Catalog BE and FE timestamp bug
Re: Catalog BE and FE timestamp bug
01.01.1970 will be returned when the timestamp field has a value of 0, as this is the beginning of Unix time.
Is your field returning ok when you add a new entry?
You may need to go into your database and adjust the tstamp field for old entries if it bothers you.
Re: Catalog BE and FE timestamp bug
Thanks for explanation, I always want to know what happened this year :)
tstamp field in DB works fine, but tstamp is int with numbers, example 12132132 (every item has working tstamp). Now how to covert that to date if its possible?
Regards,
W.
Re: Catalog BE and FE timestamp bug
again, i haven't used catalog so i'm a bit lost - but if you already have a timestamp integer that you wish to format, you won't need string to time -strtotime() - as the integer is not a string and is already a time.
so try
Code:
<?php echo date("d.m.Y", $entry['data']['tstamp']['value']); ?>
Re: Catalog BE and FE timestamp bug
Quote:
Originally Posted by ramjet
again, i haven't used catalog so i'm a bit lost - but if you already have a timestamp integer that you wish to format, you won't need string to time -strtotime() - as the integer is not a string and is already a time.
so try
Code:
<?php echo date("d.m.Y", $entry['data']['tstamp']['value']); ?>
Thank you for your answare but it returns me again the unix time.