date

链表

杀马特。学长 韩版系。学妹 提交于 2020-03-28 12:38:46
指针的作用用来存储地址 int a; int *p; 定义一个存储整型变量的地址的指针 p=&a; 保存a的地址; pritnf("%d," *p); 输出p存储地址的值 *的作用{1.表乘法 2.申明一个指针,在定义指针变量时使用 3.间接运算符,取得指针所指向的内存中的值} #include<iostream> #include<cstdlib> using namespace std; struct node{ int date; struct node *next; }; int main(){ int n,date,number; struct node *head,*q,*p,*t; head=NULL; cin>>n; for(int i=1;i<=n;i++){ cin>>date; p=(struct node *)malloc(sizeof(struct node)); p->date=date; p->next=NULL; if(head == NULL){ head=p; }else{ q->next=p; } q=p; } t=head; while(t!=NULL){ cout<<t->date<<' '; t=t->next; } //Insert a number cin>>number; t=head; while(t!=NULL){ if(t-

MySQL:MySQL日期数据类型、MySQL时间类型使用总结

梦想的初衷 提交于 2020-03-28 07:39:03
MySQL 日期类型:日期格式、所占存储空间、日期范围 比较。 日期类型 存储空间 日期格式 日期范围 ------------ --------- --------------------- ----------------------------------------- datetime 8 bytes YYYY-MM-DD HH:MM:SS 1000-01-01 00:00:00 ~ 9999-12-31 23:59:59 timestamp 4 bytes YYYY-MM-DD HH:MM:SS 1970-01-01 00:00:01 ~ 2038 date 3 bytes YYYY-MM-DD 1000-01-01 ~ 9999-12-31 year 1 bytes YYYY 1901 ~ 2155 在 MySQL 中创建表时,对照上面的表格,很容易就能选择到合适自己的数据类型。不过到底是选择 datetime 还是 timestamp,可能会有点犯难。这两个日期时间类型各有优点:datetime 的日期范围比较大;timestamp 所占存储空间比较小,只是 datetime 的一半。 另外,timestamp 类型的列还有个特性:默认情况下,在 insert, update 数据时,timestamp 列会自动以当前时间(CURRENT_TIMESTAMP)填充

How to disable different months in each of the datepicker range years using beforeShowDay method

三世轮回 提交于 2020-03-28 05:54:40
问题 I would like to disable different months in each of of datepicker years specifically the start year and the end year. I know I can use the beforeShowDay method to run some code that can return true and false to enable/disable dates. Right now I want to disable months Sept - Dec in 2005 and Nov + Dec in 2009 but I'm not completely sure how to do this. When I log out date.getYear() I get numbers like 104 an 105 when I would expect to get 2014 and 2015 etc so I'm not sure how I can check the

python time模块和datetime模块

依然范特西╮ 提交于 2020-03-28 04:17:45
python time模块和datetime模块 一、time模块 time模块中时间表现的格式主要有三种:   a、timestamp时间戳,时间戳表示的是从1970年1月1日00:00:00开始按秒计算的偏移量   b、struct_time时间元组,共有九个元素组。   c、format time 格式化时间,已格式化的结构使时间更具可读性。包括自定义格式和固定格式。 1、时间格式转换图: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #! /usr/bin/env python # -*- coding:utf-8 -*- # __author__ = "TKQ" import time # 生成timestamp time.time() # 1477471508.05 #struct_time to timestamp time.mktime(time.localtime()) #生成struct_time # timestamp to struct_time 本地时间 time.localtime() time.localtime(time.time()) # time.struct_time(tm_year

阿里Java开发规约(1)

允我心安 提交于 2020-03-28 02:56:17
本文是对阿里插件中规约的详细解释一,关于插件使用,请 参考这里 1. ArrayList的subList结果不可强转成ArrayList,否则会抛出ClassCastException异常。 说明:禁止强转,如果需要用到集合特性方法,请新建一个集合,然后置入sublist,new 集合(sublist结果)。 Negative example: List<String> list = new ArrayList<String>(); list.add("22"); //warn List<String> test = (ArrayList<String>) list.subList(0, 1); Positive example: List<String> list2 = new ArrayList<String>(list.subList(0, 1)); 2. iBATIS自带的queryForList(String statementName,int start,int size)不推荐使用 3. long或者Long初始赋值时,必须使用大写的L,不能是小写的l,小写容易跟数字1混淆,造成误解。 (注:规约) Negative example: //It is hard to tell whether it is number 11 or Long 1. Long warn =

time与date time模块

南楼画角 提交于 2020-03-28 02:41:22
一,内建模块:   python中,表示 时间 的方式:     (1)时间戳(timestamp)       通常来说时间戳表示的是从1970年1月1日00:00:00开始按秒计算偏移量     (2)格式化的时间字符串     (3)元祖(struct_time,共9个元素)       返回struct_time的函数主要有:gmtime(),localtime(),striptime()      1 #!/usr/bin/python 2 __auther__ = "Mr.zhang" 3 4 import time 5 6 print(time.process_time()) #测量处理器运算时间,不包括sleep时间,2版本使用的是clock() 7 print(time.altzone) #返回UTC时间的时间差,按照秒计算 8 print(time.localtime()) #返回本地时间的struct time对象格式 9 print(time.gmtime(time.time()-800000)) #返回UTC时间的struct time对象格式 10 print(time.asctime(time.localtime())) #返回时间格式Thu Mar 29 10:47:01 2018 11 print(time.ctime()) #返回时间格式Thu

java时间操作

白昼怎懂夜的黑 提交于 2020-03-28 01:02:09
这篇讲的也很专业: http://soft.zdnet.com.cn/software_zone/2007/1129/660028.shtml java 中的时间操作不外乎这四种情况: 1 、获取当前时间 2 、获取某个时间的某种格式 3 、设置时间 4 、时间的运算 好,下面就针对这四种情况,一个一个搞定。 一、获取当前时间 有两种方式可以获得,第一种,使用 Date 类。 j2SE 的包里有两个 Date 类,一个是 java.sql.Date, 一个是 java.util.Date 这里,要使用 java.util.Date 。获取当前时间的代码如下 Date date = new Date(); date.getTime() ; 还有一种方式,使用 System.currentTimeMillis() ; 这两种方式获得的结果是一样的,都是得到一个当前的时间的 long 型的时间的毫秒值,这个值实际上是当前时间值与 1970 年一月一号零时零分零秒相差的毫秒数。 当前的时间得到了,但实际的应用中最后往往不是要用这个 long 型的东西,用户希望得到的往往是一个时间的字符串,比如“ 2006 年 6 月 18 号”,或“ 2006-06-18 ”,老外可能希望得到的是“ 06-18-2006 ”,诸如此类等等。这就是下一个要解决的问题 二、获取某个时间的某种格式

java 日期 加减 运算

喜你入骨 提交于 2020-03-27 22:15:14
import java.util.Date; import java.text.SimpleDateFormat; import java.util.Calendar; public class DateTest { /** * @param args */ public static void main(String[] args) throws Exception { // TODO 自动生成方法存根 //日期相减算出秒的算法 Date date1 = new SimpleDateFormat("yyyy-mm-dd").parse("2005-06-08"); Date date2 = new SimpleDateFormat("yyyy-mm-dd").parse("2006-06-12"); long l = date1.getTime()-date2.getTime()>0 ? date1.getTime()-date2.getTime(): date2.getTime()-date1.getTime(); //System.out.println(l/1000+"秒"); //日期相减得到相差的日期 long day = (date1.getTime()-date2.getTime())/(24*60*60*1000)>0 ? (date1.getTime()

Java 日期加减计算.

女生的网名这么多〃 提交于 2020-03-27 22:12:15
1.用 Java .util.Calender来实现 Calendar calendar=Calendar.getInstance(); calendar.setTime(new Date()); System.out.println(calendar.get(Calendar.DAY_OF_MONTH));//今天的日期 calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)+3);//日期加3 System.out.println(calendar.get(Calendar.DATE));//加3之后的日期 2.用 java .text.SimpleDateFormat和 java .util.Date来实现 Date d=new Date(); SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); System.out.println("今天的日期:"+df.format(d)); System.out.println("两天前的日期:" + df.format(new Date(d.getTime() - 2 * 24 * 60 * 60 * 1000))); System.out.println("三天后的日期:" + df

JS精美日历时间控件

不羁的心 提交于 2020-03-27 20:52:28
1、完整日历时间控件 <script> var bMoveable=true; var strFrame; document.writeln('<iframe id=endDateLayer frameborder=0 width=162 height=211 style="position: absolute; z-index: 9998; display: none"></iframe>'); strFrame='<style>'; strFrame+='INPUT.button{BORDER-RIGHT: #63A3E9 1px solid;BORDER-TOP: #63A3E9 1px solid;BORDER-LEFT: #63A3E9 1px solid;'; strFrame+='BORDER-BOTTOM: #63A3E9 1px solid;BACKGROUND-COLOR: #63A3E9;font-family:宋体;}'; strFrame+='TD{FONT-SIZE: 9pt;font-family:宋体;}'; strFrame+='</style>'; strFrame+='<scr' + 'ipt>'; strFrame+='var datelayerx,datelayery;'; strFrame+='var bDrag;'; strFrame+