I need to convert the UNIX_TIMESTAMP()
output into a readable date and time for output in a table. Anyone know how to do this? or am I in the wrong area again?
GraficRegret 0 Junior Poster
Recommended Answers
Jump to Post$ts; // timestamp value echo date('j-n-Y h:i:s a', $ts);
Jump to PostSorry GR. I'm totally lost with regard to what you're trying to do. This unix timestamp - are you storing it in the DB? The 'normal' date format - what's happening with this - from your code it looks as though you're storing this. Could you rephrase your needs / …
Jump to PostOK, store datetimes either as unix timestamp (INT) or datetime (DATETIME) - which will be in the Y-m-d H:i:s format. DO NOT store date/times in custom format if you can avoid it. Searching and comparing dates is then very difficult.
You can use a number of different php functions, e.g. …
Jump to Postusing NOW() only displays the year, thanks for the input though. I have no idea why these commands are not executing propperly.
You may have set your INT size in your Table FIELD to too small a number for the timestamp field. Leave the size blank for now.
…
All 17 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
GraficRegret 0 Junior Poster

diafol
GraficRegret 0 Junior Poster
GraficRegret 0 Junior Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
GraficRegret 0 Junior Poster

diafol
GraficRegret 0 Junior Poster
GraficRegret 0 Junior Poster

diafol
GraficRegret 0 Junior Poster
EvolutionFallen 107 Junior Poster
GraficRegret 0 Junior Poster

diafol
GraficRegret 0 Junior Poster
GraficRegret 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.