View Full Version : date formating question
03-21-2004, 09:45 AM
Hi, I am wondering how I would convert a date from the format of
2004-03-21 00:00:00 into 3/21/04 I am not to great in php so I dont know how to do this in php.
03-21-2004, 02:46 PM
03-22-2004, 06:43 AM
Great :thumbsup: thanks :D
03-22-2004, 07:25 AM
For everyone who reads this thread, I would like to stress emphasis on Unix Timestamps.
What is a unix timestamp?
A unix timestamp is a number that calculates the date relative to the epoch (the 1/1/1970, i think, either that or '75). It tells the computer how many seconds since the epoch you are talking about in time.
THIS: SELECT Now()
THIS: SELECT UNIX_TIMESTAMP()
THIS: SELECT UNIX_TIMESTAMP(Now())
From what we see here, we're selecting the time from SQL (alternatively, you can get the time from the function: time())
The difference is that because the first two are in Unix Timestamp format, you can pass them through the date() function in PHP to show the kind of date that you want.
Despite the name
Despite the name, yes you can use Unix Timestamps on Windows servers.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.