Formatting date, time and time zone with php is a very easy task. You may have a date
string in your database like (March 7, 2009, 5:16 pm), (03.10.01), (Sat Mar 10 15:16:08 MST 2001)
or as a timestamp like (1232886599) or something else. But you want to show this time in other
formats.
As example, you may have (March 7, 2009, 5:16 pm), but you want show this as 10-03-2001. So how
will you do this task? The answer is simple. Following code shows that
[sourcecode language=’php’]
[/sourcecode]
You can make any kind of formate with the timestamp. So, at first you need to convert the date
in timestamp.
Another Thing is to show a time in your time zone. How to do this?
[sourcecode language=’php’]
[/sourcecode]
That was preety easy
One thought on “Formatting date, time and time zone with php”