Is there any way to get the date (year month day) and time (hours and minutes) from a getTime type of data?
I have a database that has dates saved as int type number, for instance, this is one of the numbers: 1460459700 (already converted to seconds as I'm using it in a php).
What I'm trying to achieve is displaying the hours on certain dates, as in you pick a date (year-month-day) and it displays the hours that I have on the database. Is there a way to do this?
I'm also using this format to save the date because the original date format is ISO 8601, since my database can't handle that format, I use getTime to change it to miliseconds/1000. If there is a more efficient way to do this, I would gladly change my code. Thanks
To show hour from a date saved as integer can use code like : $datetime = 1460459700 ; date('d-m-y h', $datetime );