社区
Java SE
帖子详情
about date
yatwql
2001-08-28 04:36:04
项目中使用了几层封装的模式,与数据库的最底层接合使用了jdbc 2.0 extention 的WebRowSet,可是发现webrowset取出的日期格式为YYYY-MM-DD,想改动为MM-DD-YYYY,想问是否有配置的地方.
...全文
172
6
打赏
收藏
about date
项目中使用了几层封装的模式,与数据库的最底层接合使用了jdbc 2.0 extention 的WebRowSet,可是发现webrowset取出的日期格式为YYYY-MM-DD,想改动为MM-DD-YYYY,想问是否有配置的地方.
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yatwql
2001-08-28
打赏
举报
回复
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat (dateFormat );
String sResult = formatter.format(dateValue);
找到以上代码,
to nhbird,不能用数据库的函数,都说用了n层封装拉
nhbird
2001-08-28
打赏
举报
回复
1.直接用数据库的函数搞定!
2.好像DataFormat类的format()方法不行,用拆成字符串处理吧,太土了:(!java里我也不知道如何搞定,java应该有这种方法的。
hexiaofeng
2001-08-28
打赏
举报
回复
public String reformat()
{
Date today = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("mm-dd-yyyy G 'at' hh:mm:ss z");
try
{
String dateString = formatter.format(today);
return dateString;
} catch (IllegalArgumentException iae) {
result.setForeground(Color.red);
result.setText("Error: " + iae.getMessage());
}
}
nhbird
2001-08-28
打赏
举报
回复
没错,用DataFormat类的format()方法。
zgpp
2001-08-28
打赏
举报
回复
使用DateFormat类是可以的!
rinehart
2001-08-28
打赏
举报
回复
察看DateFormat类
g++ for windows
Installing c++/g++ on Windows Disclaimer: This page is being maintained mainly for my students. Use these instructions at your own risk. There is no warranty in any form or shape whatsoever!. There is no guarantee that these instructions are up-to-
date
. With that understood you may continue with the rest of this page if you choose to accept these terms. This page was last up
date
d on September 13, 2005, but still good as of April 30, 2009. Follow these steps to install g++ (the GNU C++ compiler) for Windows. There is no room for creativity here; you must follow the directions exactly. Pick the drive and a folder in which you want to install g++. I'll assume that it is C:, but you can choose a different one. If you choose a different drive or a different folder, you'll need to adapt the directions below accordingly. Download full.exe, an
ab
out 14 meg
ab
yte execut
ab
le, to C:\full.exe by right-clicking on the link. Use Save Link As... or Save Target As... Be sure the browser saves the file as C:\full.exe. Run the downloaded execut
ab
le. This will install g++ (and a lot of other things that you don't really need) on your hard drive. Go to the C: drive using Windows Explorer and double-click on full.exe. Or, open a DOS window (Start > Programs > Command Prompt), connect to the C: drive using the cd command, and type full. Locate where the bin folder was created for the g++ installation. On my Windows XP machine, it was created in the following path: C:\cygnus\cygwin-b20\H-i586-cygwin32\bin You now should add it to the PATH environment vari
ab
le. You do that by following: Start -> Control Panel -> System -> Advanced -> Environment Vari
ab
les At this point you can see the PATH vari
ab
le either in the User Vari
ab
les or in the System Vari
ab
les. Add the g++ path into the PATH vari
ab
le. You add it to the end of the existing value separated by a semicolon (';'). Make sure that you do not lose the original value. You are just appending more to the end separated by a semicolon. Restart your computer. A Cygnus Solutions entry will appear in your Programs menu, and an icon may appear on your desktop. Don't use them! You will use it using the g++ command on a DOS prompt as explained below. You should now be
ab
le to run g++ from a DOS (Command Prompt) window. For example, to compile a file called C:\mine\hello.cpp, connect to the C:\mine folder and enter g++ -g hello.cpp -o hello -lm You'll then be
ab
le to run the compiled program by entering hello in the DOS window. If you've installed Emacs as described here, you will also be
ab
le to run g++ from Emacs. If, when you do this, Emacs tries to compile with the command make -k, you made a mistake during the Emacs installation. If you want to learn how to run g++ on emacs, see here. If you'd like to learn more
ab
out where this free compiler came from, we downloaded it from an older site of http://sourceware.org/cygwin/. If you wish to clean up a little, you may delete the file: full.exe at this point. Your g++ compiler is installed under C:\cygnus.
An problem
ab
out
date
An problem
ab
out
date
时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 acm的iphxer经常忘记某天是星期几,但是他记那天的具体日期,他希望你能写个程序帮帮他。 输入每行有三个整数 year,month,day,日期在1600年1月1日到9600年1月1日之间; 输出输出对应的星期,用一个整
NYOJ-219 An problem
ab
out
date
An problem
ab
out
date
时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 acm的iphxer经常忘记某天是星期几,但是他记那天的具体日期,他希望你能写个程序帮帮他。 输入每行有三个整数 year,month,day,日期在1600年1月1日到9600年1月1日之间; 输出输出对应的星期,用一个整
NYOJ 题目219 An problem
ab
out
date
(数学,吉姆拉尔森公式)
An problem
ab
out
date
时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 acm的iphxer经常忘记某天是星期几,但是他记那天的具体日期,他希望你能写个程序帮帮他。 输入每行有三个整数 year,month,day,日期在1600年1月1日到9600年1月1日之间; 输出输出对应的星期,用一个整
NYOJ - An problem
ab
out
date
An problem
ab
out
date
时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 acm的iphxer经常忘记某天是星期几,但是他记那天的具体日期,他希望你能写个程序帮帮他。 输入每行有三个整数 year,month,day,日期在1600年1月1日到9600年1月1日之间;输出输出对应的星期,用一个整数表示;
Java SE
62,634
社区成员
307,269
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章