public class DateParserT { /** * Date 与 String.long 的相互转换 * @param args */ public static void main(String[] args) { Date dt =new Date(); System.out.println(dt)
Date类学习总结 1.计算某一月份的最大天数 Calendar time=Calendar.getInstance();time.clear();time.set(Calendar.YEAR,year); //year 为 int time.set(Calendar.MONTH,i-1);//注意,Calendar对象默认一月为0 int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//本月份的天数注:在使用set方法之
话不多说,上程序,如图: public class TestDate { public static void main(String[] args) throws ParseException { String str = "2016-6-28 8:00:00"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //字符串转Date Date date = sdf.parse(
虽然说看文档最好是看官方原来的文档,但是呢,下面是我看别的人的总结,算做抛砖引玉吧,如果有不对的,我会在后期给更正或者自己来写一篇 1,JAVA中对xml的操作,包括schema,dtd等相关知识:标记语言 2,JAVA中对时间类和对象的操作,时间主要有三种类型,Long,Date,Calender,关于时间格式用SimplyDateFormat来设置,具体的见下面, 时间日期 时间类型转换 long <-> Date <-> Calendar long --->Date :
select语句中只能使用sql函数对字段进行操作(链接sql server),select 字段1 from 表1 where 字段1.IndexOf("云")=1;这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了.left()是sql函数.select 字段1 from 表1 where charindex('云',字段1)=1; 字符串函数对二进制数据.字符串和表达式执行不同的运算.此类函数作用于CHAR.VARCHAR. BINARY. 和
select语句中只能使用sql函数对字段进行操作(链接sql server), select 字段1 from 表1 where 字段1.IndexOf("云")=1;这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了.left()是sql函数.select 字段1 from 表1 where charindex('云',字段1)=1; 字符串函数对二进制数据.字符串和表达式执行不同的运算.此类函数作用于CHAR.VARCHAR. BINARY.
在一段判断是否过期的js代码中是这么写的: if (new Date() < new Date(2014, 9, 25)) { //... } 后来发现过了9月25日竟然不过期,console.log打印一下new Date(2014, 9, 25)的值: Sat Oct 25 2014 00:00:00 GMT+0800 (CST) 竟然变成了10月25日!于是,判断是否过期的js代码形同虚设,永远也不会过期. 原来javscript中的new Date(year, month, day, h