Results 1 to 8 of 8

Thread: Catalog BE and FE timestamp bug

  1. #1

    Default 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.
    Web design agency - EDsolution.si Izdelava spletnih strani

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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...

  3. #3

    Default 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.
    Web design agency - EDsolution.si Izdelava spletnih strani

  4. #4

    Default Re: Catalog BE and FE timestamp bug

    Anyone?
    Web design agency - EDsolution.si Izdelava spletnih strani

  5. #5
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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.

  6. #6

    Default 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.
    Web design agency - EDsolution.si Izdelava spletnih strani

  7. #7
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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']); ?>

  8. #8

    Default 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.
    Web design agency - EDsolution.si Izdelava spletnih strani

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •