nikola Posted May 24, 2012 Share Posted May 24, 2012 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? Link to comment Share on other sites More sharing options...
diogo Posted May 24, 2012 Share Posted May 24, 2012 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? Link to comment Share on other sites More sharing options...
nikola Posted May 24, 2012 Author Share Posted May 24, 2012 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); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now