CodeIgniter Forums
Wrong Unix_to_human conversion - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Wrong Unix_to_human conversion (/showthread.php?tid=5122)



Wrong Unix_to_human conversion - El Forum - 01-07-2008

[eluser]murphy2006[/eluser]
Hello,

I am experiencing a strange problem with my CI app. When I save a date in Unix format into the database it works fine but the problem is with the Unix to Human conversion, it fails on some pages and on some it works perfectly fine, with the same unix timestamp!

The correct date should be: 2008-01-07 23:23
The incorrect date are ALL shown (even if the stamps are different): 2007-12-31 12:56

Does anyone know what is wrong with this?
The code I use for the conversion is the below one. The same code is used on
both working and not working pages.

Code:
<?php echo unix_to_human($details->registered, FALSE, 'eu'); ?>

Please help!

Kind Regards,
Daniel


Wrong Unix_to_human conversion - El Forum - 01-07-2008

[eluser]tonanbarbarian[/eluser]
I cannot see how you could be getting this problem unless the timestamps are in fact not the same


Wrong Unix_to_human conversion - El Forum - 01-08-2008

[eluser]murphy2006[/eluser]
Well, I am even pasted another unix stamp into the current post and vice versa and I still get the same errornous date. I have tried this locally and on my online server, same problem.

I have checked the code over and over again, both controller and view file and I cannot find the problem.

/Daniel