Sean, here's a php function that returns a formatted date. This currently
returns a US formatted date but you can easily change it to Australian.
// convert timestamp to date for display.
function displayDate($timeStamp, $separator="/", $leading="f") {
$arr = explode("-", $timeStamp);
if ($leading == "t") {
$month = $arr[1];
$day = $arr[2];
$year = $arr[0];
} else {
$month = (integer) $arr[1];
$day = (integer) $arr[2];
$year = (integer) $arr[0];
}
return "$month$separator$day$separator$year";
}
> I am reading a data datatype from a PostgreSQL database,
>
> the format sohwing is 2001-01-05 for the 1st of May this year,
>
> I need this date in Australian format i.e. 01/05/2001,
>
> I tried using the string date (string format [, int timestamp])
>
> but with no success.I am not sure how to convert the database variable into
> a timestamp.
>
> any suggestions ?
>
> Sean Weissensee
Micah
--
Micah Woods
Woods/IT LLC
2214 Waite Ave.
Kalamazoo, MI 49008
v: 616 349-1175
f: 877 349-4929 (toll free)
e: [EMAIL PROTECTED]
w: http://www.woods-it.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]