预览模式: 普通 | 列表
08-06
20

format String to Date

jdk中已经不再推荐用Date.parse(String arg);这样的直接的转换,取而代之的是:
                     String birthdayS = request.getParameter("birthday");
            DateFormat f=new SimpleDateFormat("yyyy-MM-dd");
            try {
                birthday=f.parse(birthdayS);
            } catch (ParseException e) {
                e.printStackTrace();
                log.error("When format birthday from String to Date  is error");
            }

查看更多...

Tags: format String Date

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 675
08-06
19

java date format

import java.util.Date;
import java.text.DateFormat;


/**
* 格式化时间类
* DateFormat.FULL = 0
* DateFormat.DEFAULT = 2
* DateFormat.LONG = 1

查看更多...

Tags: java Date format

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1168
08-06
19

速度超快的日期选择程序(二),类似phpAdmin

把以下代码存为:calendar.js
-------------------代码开始------------------------
document.write("<div id=meizzCalendarLayer style='position: absolute; z-index: 9999; width: 144; height: 193; display: none'>");
document.write("<iframe name=meizzCalendarIframe scrolling=no frameborder=0 width=100% height=100%></iframe></div>");
function writeIframe()
{
    var strIframe = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><style>"+
    "*{font-size: 12px; font-family: 宋体}"+
    ".bg{  color: "+ WebCalendar.lightColor +"; cursor: default; background-color: "+ WebCalendar.darkColor +";}"+

查看更多...

Tags: 日期 选择 phpAdmin

分类:Ajax/Js | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 1093
08-06
19

日期选择程序(一)

maorr_calendar.js
/*=======Calendar.js==============*/  
  
var months = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");    
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);    
var days = new Array("日","一","二","三","四","五","六");    
var today;    
  
document.writeln("<div id='Calendar' style='position:absolute; z-index:1; visibility: hidden; filter:\"progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#999999,strength=3)\"'></div>");  

查看更多...

Tags: 日期 选择

分类:Ajax/Js | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 646
The method setValue(String) in the type BaseInputTag is not applicable for the arguments (double)
这个错误一看就是转型错误
<html:text>表情只支持String 类型的变量,其他类型的变量需要先转换成String类型,如String.valueOf(double);

查看更多...

Tags: text String double

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2145
08-06
18

Error performing load command

could not read column value from result set :某某字段(birthday)

出现了这样的错误,反复对照,映射文件没问题,字段没问题。

问题在哪呢?测试了下,如果birthday是String 类型的,没问题。如果是Date类型的。出错,其实原因很简单了,把记录中birthday字段的默认值0000 00-00-00改为正常即可

Tags: performing Date

分类:Database | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 957