Jump to content

Recommended Posts

Posted

I've assigned datetime type to a field that I've added to user template. When I try to output it, it shows me 1333425600 (I'm making unix timestamp conversion through date conversion to show me the right format) and I get - 31.12.1969 date which shows me that something is wrong here.

When using this kind of field in normal template everything works fine and I don't need to do any conversion.

How can I display the right date?

Posted

The problem is in the conversion. the date you are getting is the beginning of the unix timestamp... can't be equivalent to that number.How did you do the conversion?

Posted

Diogo,

I've solved it, there was an extra strtotime in echo...

It's working this way:

$date = 1333425600;
echo date('d.m.Y', $date);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...