I have this problem:
i save the date in an mysql data base using time () - in seconds - and i try to display it as a date d-m-y, but i can't figure it out...
How can i display the date using something like this:
date ("d-m-y", time(obj['data']))
i save the time in seconds since the epoch. my problem is to store the date when i added the item in the database and display it normaly, as m-d-y
You have 2 options
1. Convert the time in seconds since epoch to date and store it in database
2. Store the time in seconds since epoch in database and convert it before display
Which ever method you choose, use date() method to format it to proper string. You will have to convert the time in seconds since epoch to timestamp before passing it to date by multiplying it by 1000 (milliseconds since epoch).
Thanks for the solutions/sugestions, i solved the problem.
Dude you never posted the script which got you what you needed, may be someone searching the same thing would come here and get it... so please i request you to do it....