开发者

print date from database [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhet开发者_JAVA百科orical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

When I pull the date out of the db, it comes back like this:

1314718511 
1314212730
1314210433
1314210352

I want like this:-

08/31/11 14:43:29 IST


Use date() (http://php.net/manual/en/function.date.php), or the DateTime class (http://php.net/manual/en/class.datetime.php) when you want to do transformations (like time zones).


If your database is MySQL also check out the from_unixtime and unix_timestamp functions. You'll see you can do this conversion either at SQL level or as Rijk pointed out, in PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜