- 论坛徽章:
- 0
|
原帖由 dkmilk 于 2006-4-11 21:32 发表
如我从数据库中查询到一日期对像
如何把这个日期对像格式化成我想要的格式?
还有,请教,我传入一个日期,如果对这个日期格式化?
Firstly using SQL to read what date format do you have.
For example, from my PostgreSQL:
test=> select now();
now
-------------------------------
2006-04-12 15:14:14.594163+02
You can see the date format (usually is ISO-format, but it's different from various database)
With those date formate you can use perl's method substr(), split(), regexp, ... etc
to process and modify it.
Best regards, ulmer |
|