go语言日历 go语言诞生时间

华为的平板可以安装windows系统吗?

华为平板是可以安装windows系统的。你直接将您的平板上的操作系统关闭,然后再重新安装您的windows操作系统。

创新互联公司专注于企业全网整合营销推广、网站重做改版、平原网站定制设计、自适应品牌网站建设、html5购物商城网站建设、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为平原等各大城市提供网站开发制作服务。

go桌面的更新历史

1.(新增)全新的壁纸和快捷条图标(在“桌面设置-个性化设置”)

2.(新增)开关和日历小部件更新2套全新样式

3.(新增)增加私密安全锁功能

4.(修复)重置的问题 1.(新功能)功能表 增加自动整理图标选项

2.(新功能)增加3种手势操控选项

3.(新功能)增加4种桌面划屏特效

4.(修复)修复部分bug 1.(新功能)增加2个滑屏特效(渐影、玻璃)

2.(新功能)主题预览、锁屏图标增加主题更新数提示

3.(新功能)增加淘宝小部件(菜单-添加-GO小部件)

4.(修复)修复某些情况下主题购买后无法使用的问题

5.(修复)针对酷派手机无法清除系统桌面默认选项的问题 1.(新功能)增加自动清理屏幕上图标的功能(菜单-屏幕清理)

2.(新功能)桌面设置增加新功能预告提示(关于GO桌面)

3.(新功能)支持Toucher主题切换(添加-主题-Toucher)

4.(修复)评分弹出的错误弹出问题 1.(新功能)全新 的系统设置页面

2.(新功能)增加GO桌面插件管理功能(菜单-周边)

3.(优化)桌面设 置增加快捷设置模块

4.(优化)支持部 分其他第三方桌面主题

5.(修复)多次弹 出评分提示框的问题

6.(修复)收费主 题在4.1系统上无法使用部分图标的问题 1(新功能) 多屏多壁纸支持选择主题壁纸

2(新功能)新建功能表文件夹可自动命名

3(优化)桌面设置分类和操作

4(修复)功能表出现两个相同图标的问题

5(修复)选择壁纸时桌面崩溃的问题 1.修复插件使用问题

2.新增多款主题 1. 增加了元旦人气主题;

2.(新功能)多屏多壁纸插件支持选择主题壁纸;

3.(优化)资源浏览模块插件化;

4.(优化)快捷条功能表图标支持删除操作(长按功能表图标-删除);

5.(优化)功能表首栏文件夹支持点击操作(功能表-长按应用图标);

6.(优化)个性化设置操作细节; 1.(优化)修改GO手册部分内容

2.(修复)Home键手势失效的问题

3.(修复)主屏幕快捷方式失效的问题

4.(修复)跳转到主屏幕时的过渡特效

5.(修复)划动屏幕出现黑屏的问题 1.(修复)进出功能表出现 残影的问题

2.(修复)Nexus 7添加界面被截断的问题

3.(修复)下划手势在4.2系统上无法使用的问题

4.(修复)GO省电导致的4.2系统崩溃问题

v3.17 更新:

1. (新功能)全新的设置界面风格(桌面菜单-桌面设置)

2. (新功能)桌面推荐小部件支持批量下载

3. (新功能)图片、音乐、视频快捷方式图标(可通过GO快捷方式添加)

4. (优化)功能表图标放入文件夹的操作体验

5. (优化)桌面图标/小部件拖动轨迹动画

6. (优化)应用中心搜索功能的操作体验

7. (优化)主程序集成通讯统计插件

8. (修复)图标裁剪的问题 1、(新功能)功能表支持上下滑手势隐藏选项卡与操作栏;

2、(新功能)图标排序支持按使用频率排序;

3、(新功能)资源浏览支持内置播放器;

4、(优化)图标自定义大小选项支持更大数值;

5、(优化)自定义手势列表缩略图增加动画效果;

6、(优化)快捷栏+号增加空白选项;

7、(修复)功能表菜单主题背景丢失的问题。 1、(新功能)UI3.0全新配套图标和网格绘制;

2、(新功能)快捷条支持自适应个数及大小;

3、(新功能)全新的操作提示UI界面;

4、(优化)软件管理支持提示可移动的手机内存/SD卡应用;

5、(优化)隐藏快捷栏后屏幕使用区域;

6、(优化)添加GO小部件的UI界面(长按桌面空白处进入)。 1、(新功能)更便捷的添加界面(长按桌面空白处进入);

2、(新功能)功能表全新的UI界面和操作体验;

3、(优化)软件管理支持区分手机内存/SD卡应用;

4、(优化)初始安装的用户提示界面和桌面摆设;

5、(优化)提升划动桌面的流畅度;

6、(修复)文件夹新样式的部分问题。 1、(新功能)全新的屏幕预览界面和操作体验(拖动删除屏幕);

2、(新功能)支持从其他桌面复制图标(高级设置内);

3、(优化)提升屏幕划动时的流畅性;

4、(优化)修改初次安装桌面的用户提示体验;

5、(修复)竖向功能表使用瀑布特效时的显示问题。 1、(新功能)GO桌面消息中心上线;

2、(新功能)GO精品全面调整UI体验,新增1x4小部件;

3、(优化)调整上下滑操作手势的默认选项(支持手势激活Menu菜单);

4、(优化)Menu菜单的“更多”选项栏的按钮排序;

5、(修复)操作手势导致的无法卸载GO桌面问题(需要安装开关小部件来使用手势锁屏功能)。 1、(新功能)Menu菜单增加消息中心入口;

2、(优化)文件夹的界面匹配和操作体验;

3、(优化)通过功能表进行应用更新的操作体验;

4、(修复)加载内存卡时导致的freeze问题。 1. (新功能)可通过“检查垃圾数据”功能清除功能表重复图标(桌面设置-高级设置);

2. (优化)功能表的历史记录显示隐藏图标问题;

3. (优化)新建功能表文件夹的响应速度;

4. (修复)功能表文件夹图标重复的问题;

5. (修复)在使用主题时出现屏幕花屏的问题; 1. (新功能)支持GO桌面整体主题,可一次性更换桌面、小部件和锁屏主题;

2. (新功能)桌面文件夹支持自定义应用图标位置;

3. (新功能)操作手势增加锁屏功能(需要申请锁屏权限,卸载时请先清除权限;

4. (优化)手势设置的设置选项和操作流程;

5. (修复)图标合并文件夹背景显示错误问题;

6. (修复)Galaxy Nexus的默认行列数错误问题。 1、新功能,桌面和功能表特效支持自定义随机特效;

2、优化桌面文件夹不显示隐藏应用;

3、优化功能表搜索的图标显示问题;

4、优化更新版本后的默认桌面设置问题。 1.(优化)功能表隐藏菜单增加确定和取消按钮;

2.(优化)修改GO精品图标的更新标识显示机制;

3.(优化)修改功能表的应用更新提示显示机制;

4.(修复)功能表在特定情况下出现的崩溃问题。 1. (新功能)桌面移动图标及小部件时显示网格标识;

2. (优化)合并文件夹后自动弹出编辑列表,可快速添加应用进入文件夹;

3. (优化)调整桌面设置内的选项排序和描述;

4. (优化)桌面锁定编辑后,不可编辑文件夹内的图标;

5. (优化)更新分享功能的文案和链接(请帮助我们分享GO桌面到微博)。 1.(新功能)快捷条图标跟随自定义图标大小功能一并修改 ;

2.(优化)选择大图标模式时,指示器返回桌面顶部 ;

3.(优化)当前屏幕空间不足添加GO小部件时,进入屏幕预览选择其他屏幕 ;

4.(优化)删除和修改大部分的弹出文案提示;

5.(优化)用户提示界面的指示器显示效果。 1.(新功能)Menu菜单新Tab样式(左右滑动);

2.(新功能)QA用户提示(关于GO桌面选项内);

3.(新功能)桌面文件夹+号快速编辑功能 ;

4.(修复)小分辨率下功能表的界面问题。 1.(新功能)GO桌面小部件添加列表支持提示更新(长按桌面——GO桌面小部件) ;

2. (新功能)完善提示系统功能表提示;

3. (优化)锁定屏幕的用户提示信息(通知栏显示解锁路径);

4. (优化)图标点击颜色的选择界面(取消返回键的提示框);

5. (修复)自定。 1.(新功能)隐藏主题图标底图(个性化设置);

2.(新功能)自定义图标字体大小;

3.(优化)功能表文件夹操作体验 ;

4.(优化)桌面图标推压的动态效果;

5.(修复)文件夹的图标缩略图放大问题。 1.(新功能)自定义图标大小(桌面设置——个性化设置——图标设置——图标大小设置);

2.(优化)GO桌面小部件管理流程;

3.(优化)屏幕预览模块提示信息 ;

4.(修复)开关小部件卸载问题。 1. 新增锁屏功能;

2. 新增功能表图标特效(3D效果);

3.(新)主题商城正式上线;

4.修复Menu键没有振动的问题;

5.优化桌面图标快捷菜单。 1.新功能:桌面支持更多行列数选择;

2.新功能:支持轨迹球屏幕翻页;

3.优化:新的快捷条图标和功能表样式;

4.修复:壁纸没有随主题更换的问题。 1.修复:在某些机型上的卡死问题(MOTO);

2.新功能:MENU菜单加入更多选项;

3.优化:退出GO桌面后清除内存残余;

4.修复:无法进入功能表编辑模式的问题;

5.修复:在高分辨率下快捷条背景错误的问题;

6.修复:乐Phone壁纸及图标错误的问题;

7.修复:修复上个版本中遗留的大量问题。 1. (新功能) Menu菜单加入更多选项;

2. (优化) 退出GO桌面后清除内存残余;

3. (修复) 无法进入功能表编辑模式的问题;

4. (修复) 在高分辨率下快捷条背景错误的问题;

5. (修复) 乐phone壁纸及图标错误的问题。 1. (修复) v2.26的严重bug;

2. (新功能) 功能表翻屏特效(5款酷炫效果);

3. (优化) 桌面及功能表图标重新加载的问题;

4. (优化) 整体内存使用率;

5. (修复) 无法进入屏幕预览的问题。 1. (新功能) 功能表翻屏特效(5款酷炫效果);

2. (优化) 桌面及功能表图标重新加载的问题;

3. (优化) 整体内存使用率;

4. (修复) 无法进入屏幕预览的问题。 1. (优化)功能表文件夹打开与关闭的背景颜色淡入淡出效果;

2. (修复)进入桌面设置崩溃的问题 – 是由于内存不足引起,请重启桌面试试(菜单-退出桌面,再进入);

3. (修复)部分机型启动卡的问题;

4. (修复)部分小分辨率/特殊分辨率机型设置壁纸不正确的问题。 1. (新功能) 更换字体功能支持扫描SD卡特定文件夹(GOLauncherEX/fonts)中的字体文件;

2. (优化) 桌面及功能表图标重新加载的问题;

3. (修复) 部分小分辨率及M9机型的主题预览和屏幕预览问题;

4. (修复) M9机型的快捷条点击问题;

5. (修复) 使用Menu键解锁时不会弹出菜单(CM6);

6. (修复) 进入桌面设置和系统设置的崩溃。 1. (新功能) 桌面操作手势支持隐藏快捷栏(桌面设置-操作设置);

2. (新功能) 新的Menu菜单界面;

3. (新功能) GO桌面小部件-任务管理支持点击单个图标关闭程序及上下翻动查看任务;

4. (优化) 提升功能表滑动流畅度;

5. (修复) 快捷条重复图标和图标消失问题;

6. (修复) 如果你经常遇到图标加载问题,请开启“常驻内存”选项(桌面设置-高级设置-常驻内存)。 1. 发布两款GO桌面小部件 - 任务管理、联系人;

2. 支持功能表文件夹与桌面文件同步;

3. 优化快捷条更换背景图的操作流程;

4. 修复内存不足导致的问题。 1. 支持更换桌面显示字体(桌面设置-高级设置);

2. 添加至桌面菜单支持批量添加应用;

3. 修复功能表文件夹卡的问题;

4. 优化功能表进出特效的效果(风车特效);

5. 优化快捷条操作体验。 1. 桌面文件夹列表增加功能表文件夹选项;

2. 增加垃圾桶和DOCK移除时的动画;

3. 修复小分辨率的机型壁纸适配问题;

4. 优化桌面图标的操作体验细节;

5. 优化功能表文件夹的操作体验细节;

2010/4/1更新:手绘主题、经典主题、水墨主题、浪漫主题、木纹主题、情人节主题特别版、喜庆主题。 1. 快捷条支持更换不同主题样式(需更新主题);

2. 优化功能表新安装程序的排序方式;

3. 文件夹打开应用后自动关闭;

4. 优化功能表进出动画;

5. 优化快捷条的通讯统计模块;

2011/3/21更新:浪漫主题、木纹主题、情人节主题特别版、喜庆主题。 1. 增加桌面图标的通讯统计显示(需先安装GO桌面通讯统计);

2. 增加进出功能表特效;

3. 增加功能表新建文件夹动画效果;

4. 修复桌面和快捷条图标重复问题(请通过“桌面设置-高级设置-检查垃圾数据”选项进行修复);

5. 修复Pure Widgets等桌面小插件无法点击及添加错误的问题;

6. 修复退出其他程序后强制关闭的问题。 1. 修复几个可能导致耗电的问题;

2. 修复关闭壁纸滚动选项后未生效的问题;

3. 修复功能表滑动屏幕缓慢的问题(2.3系统);

4. 修复重启手机后,主题图标消失的问题;

5. 优化屏幕预览的进出特效;

6. 优化屏幕预览删除屏幕的准确性;

7. 增加功能表卸载程序小动画;

8. 支持功能表文件夹图标排序。 1.增加设置备份与还原功能(高级设置内);

2.支持自定义快捷条背景;

3.支持不滚动壁纸(显示设置内的“壁纸滚动”选项);

4.修复屏幕MENU菜单settings按钮无法打开问题(Galaxy S /Epic 4G /Droid);

5.修复widget显示不完整的问题(Pure Widget /Jorte /Greek Eortologio);

6.修复桌面联系人快捷方式奔溃问题 (Droid)。 1.快捷条图标支持打开快捷方式;

2.增加功能表关闭程序白名单;

3.增加常驻内存与阻止强制关闭选项;

4.修复内存溢出崩溃与功能表图标重复问题;

5.提升打开功能表速度;

6.支持繁体中文语言。 1.增加圣诞元素主题;

2.支持长按搜索键响应;

3.修复重启后自定义图标失效问题;

4.修复内存溢出后程序崩溃问题。 1.修复V1.20中直接更新导致的问题与崩溃问题;

2.新增功能表文件夹:在功能表内拖动图标重叠可新建文件夹;

3.支持可滑动窗口小部件与调整小部件大小;

4.支持自定义图标样式(测试功能);

5.解决某些机型奔溃问题,例如Droid和Droid X;

6.解决图标更新后消失与动态壁纸交互问题。 1.新增功能表文件夹:在功能表内拖动图标重叠可新建文件夹;

2.支持可滑动窗口小部件与调整小部件大小;

3.支持自定义图标样式(测试功能);

4.优化运行速度与功能表响应速度;

5.解决某些机型奔溃问题,例如Droid和Droid X;

6.解决图标更新后消失、错位问题;

7.支持动态壁纸交互响应。 1.支持日文使用;

2.修复小写字母开头应用排序错误问题;

3.修复部分初次进入强制关闭问题;

4.修复部分机型滑动缓慢问题;

5.改善运行中的电池消耗量。 1.修复部分初次进入强制关闭问题;

2.修复部分机型滑动缓慢问题;

3.改善运行中的电池消耗量。 1.支持功能表字母排序;

2.支持功能表时间排序。 1.提升屏幕滚动速度(更顺畅);

2.修复SD卡应用程序图标遗失问题;

3.修复某些机型的异常崩溃问题。 1.修复使用app organize添加文件夹消失问题;

2.修复隐藏状态栏功能。

年历处理程序 C语言

我以前写过的一个程序可以满足你这个要求。1、2对应你的1、2。5对应你的3 。5就是输入两个日期,求两个日期之间间隔多少天,你可以把今天和需要的那天输进去。

*Press 1* See calendar of a certain year.

*Press 2* See calendar of a certain month in a certain year.

*Press 3* See what day is a certain date.

*Press 4* See how many days are there in a certain year.

*Press 5* See how many days are there between two dates.

(You enter the date today and the dead line to see

how many days are left.)

这个程序就两个文件calendar.h, calendar.cpp

//calendar.cpp

#include iostream

#include string

#include iomanip //for setw()

#include cctype //for toupper()

#include cmath //for abs()

#include "calendar.h"

using namespace std;

//bool Is_Valid(/*in*/ int item,

// /*in*/ bool condition1 = true,

// /*in*/ bool condition2 = true)

//Check if the item is valid

//precondition:

// Arguments have been assigned values

//postcondition:

// true if the item is valid

// false if the item is invalid

/*

{

if(!condition1 || !condition2)

{

cout "Invalid item!" endl;

cout "The item should not be less than one!" endl;

cout "Enter again!" endl;

return false;

}

else

return true;

}

*/

bool Is_Valid(/*in*/ bool condition1 = true,

/*in*/ bool condition2 = true,

/*in*/ string condi_str1 = "",

/*in*/ string condi_str2 = "")

//Check if the item is valid

//precondition:

// Arguments have been assigned values

//postcondition:

// true if the item is valid

// false if the item is invalid

{

if(!condition1 || !condition2)

{

cout "Invalid item!" endl;

cout "Please check if the item meet the condition(s):" endl;

cout "1: " condi_str1 endl;

cout "2: " condi_str2 endl;

cout "Enter again!" endl;

return false;

}

else

return true;

}

template class T void swap(T *x, T *y )

{

T *temp = *x ;

*x = *y ;

*y = *temp ;

}

void See_Year_Cal()

{

int year;

cout "So you want to see calendar of a certain year." endl;

cout "Please enter the year:";

cin year;

Date a_date;

a_date.Set_Year(year);

cout endl;

a_date.PrintAll();

}

void See_Mon_Cal()

{

int year;

int month;

cout "So you want to see calendar of a certain month in a certain year. " endl;

do

{

cout "Please enter the year and month:";

cin year month;

}while(!Is_Valid(month 0,month 13,"month 0","month 13"));

Date a_date;

a_date.Set_Mon(year,month);

a_date.Print_A_Mon();

}

void See_WD()

{

Date a_date;

int year;

int month;

int date;

cout "So you want to see what day is a certain date. " endl;

do

{

cout "Please enter the year and month:";

cin year month;

}while(!Is_Valid(month 0,month 13,"month 0","month 13"));

do

{

cout "Please enter the date:";

cin date;

}while(!Is_Valid(date 0,date = a_date.Get_Days(),"date 0","date = days in the month"));

a_date.Set_Date(year,month,date);

cout endl;

cout year " / " month " / " date " is " a_date.What_Day() endl;

}

void See_DsIY()

{

int year;

cout "So you want to see how many days are there in a certain year. " endl;

cout "Please enter the year:";

cin year;

Year a_year(year);

cout endl;

cout "There are " a_year.Get_DsIY() " days in " year endl;

}

void See_Diff()

{

int year[2];

int month[2];

int date[2];

cout "So you want to see how many days are there between two dates." endl;

for(int i = 0;i 2;i++)

{

do

{

cout "Please enter year" i+1 " and month" i+1 ':';

cin year[i] month[i];

}while(!Is_Valid(month[i] 0,month[i] 13,"month 0","month 13"));

do

{

cout "Please enter the date" i+1 ":";

cin date[i];

}while(!Is_Valid(date[i] 0,date[i] = Days_In_Mon(year[i],month[i]),"date 0","date = days in the month"));

}

Date a_date[2];

for(i = 0;i 2;i++)

a_date[i].Set_Date(year[i],month[i],date[i]);

if(year[0] year[1])

swap(a_date[0],a_date[1]);

cout "There are " abs(a_date[0].Days_Between(a_date[1])) " days" endl;

cout " between " year[0] " - " month[0] " - " date[0] endl;

cout " and " year[1] " - " month[1] " - " date[1] endl;

}

void Take_Act(char choice)

{

switch(choice)

{

case '1':

See_Year_Cal();

break;

case '2':

See_Mon_Cal();

break;

case '3':

See_WD();

break;

case '4':

See_DsIY();

break;

case '5':

See_Diff();

break;

default: ;

}

}

int main()

{

char choice;

cout "What do you want to do?" endl endl;

cout "*Press 1* See calendar of a certain year." endl;

cout "*Press 2* See calendar of a certain month in a certain year. " endl;

cout "*Press 3* See what day is a certain date. " endl;

cout "*Press 4* See how many days are there in a certain year. " endl;

cout "*Press 5* See how many days are there between two dates." endl;

cout " (You enter the date today and the dead line to see" endl;

cout " how many days are left.) " endl;

cout "*Press q* Quit." endl endl;

cout "And then press enter." endl endl;

do

{

cin choice;

if(toupper(choice) == 'Q')

{

cout "Are you sure you want to quit? Y or N" endl;

Y_or_N: cin choice;

if(toupper(choice) == 'Y')

break;

else if(toupper(choice) == 'N')

{

cout "So what do you want to do next?" endl;

continue;

}

else

{

cout "Invalid!" endl;

cout "You should enter Y or N" endl;

cout "Please enter again:" ;

goto Y_or_N;

}

}

else if(choice != '1' choice != '2' choice != '3'

choice != '4' choice != '5')

{

cout "Invalid item!" endl;

cout "You should enter 1,2,3,4,5 or q." endl;

cout "Please enter again:" ;

continue;

}

Take_Act(choice);

cout endl "What else do you want to do?" endl;

cout "Press 1,2,3,4,5 or q to choose." endl;

cout "If you can't remember,go to the top and check it out." endl endl;

}while(true);

return 0;

}

//calendar.h

#ifndef CALENDAR_H

#define CALENDAR_H

#include iostream

#include string

#include iomanip //for setw()

using namespace std;

int Days_In_Mon(int year,int mon)

{

switch( mon )

{

case 1:

case 3:

case 5:

case 7:

case 8:

case 10:

case 12:

return 31 ;

case 4:

case 6:

case 9:

case 11:

return 30 ;

case 2:

if( ( year % 4 == 0 ) ( year % 100 != 0 ) || ( year % 400 == 0 ) )

return 29 ;

else

return 28 ;

default:

return 0;

}

}

int Days_In_Year(int year)

{

if( ( year % 4 == 0 ) ( year % 100 != 0 ) || ( year % 400 == 0 ) )

return 366;

else

return 365;

}

int Nyd(int year)

{

int nyd;

int diff = 0; //days between year and 2007

int curr_year;

int min_year;

int max_year;

if(year 2007)

{

min_year = year;

max_year = 2007;

}

else

{

min_year = 2007;

max_year = year;

}

for(curr_year = min_year;curr_year max_year;curr_year++)

{

diff += Days_In_Year(curr_year);

}

if(year 2007)

nyd = -(diff % 7) + 1;

else

nyd = diff % 7 + 1;

if(nyd 0)

nyd += 7;

else if(nyd 6)

nyd -= 7;

return nyd;

}

//某年的某月的第一天是周几

int Start_Day(int year,int NYD /*New Year Day*/,int mon)

{

int pre_days = NYD;

for(int i = 0;i mon;i++)

pre_days += Days_In_Mon(year,i);

return (pre_days % 7);

}

string Dig_Mon(int mon)

{

switch(mon)

{

case 1:

return "January";

case 2:

return "February";

case 3:

return "March";

case 4:

return "April";

case 5:

return "May";

case 6:

return "June";

case 7:

return "July";

case 8:

return "August";

case 9:

return "semtember";

case 10:

return "October";

case 11:

return "November";

case 12:

return "December";

default: ;

}

}

string Dig_Day(int day)

{

switch(day)

{

case 0:

return "Sunday";

case 1:

return "Monday";

case 2:

return "Tuesday";

case 3:

return "Wednesday";

case 4:

return "Thursday";

case 5:

return "Friday";

case 6:

return "Saturday";

default: ;

}

}

class Year

{

public:

Year()

{

this_year = 2007;

NYD = 1;

days_in_year = 365;

}

Year(int year)

{

Set_Year(year);

}

int Get_year()

{

return this_year;

}

int Get_NYD()

{

return NYD;

}

int Get_DsIY()

{

return days_in_year;

}

void Set_Year(int year)

{

this_year = year;

NYD = Nyd(year);

days_in_year = Days_In_Year(year);

}

~Year(){}

private:

int this_year;

int NYD;

int days_in_year;

};

class Month : public Year

{

public:

Month() : Year()

{

this_mon = 1;

days_in_mon = Days_In_Mon(Get_year(),1);

start_day = Start_Day(Get_year(),Get_NYD(),1);

}

Month(int year,int mon)

{

Set_Mon(year,mon);

}

int Get_Mon()

{

return this_mon;

}

int Get_Days()

{

return days_in_mon;

}

int Get_sd()

{

return start_day;

}

void Set_Mon(int year,int mon)

{

Set_Year(year);

this_mon = mon;

days_in_mon = Days_In_Mon(year,mon);

start_day = Start_Day(year,Get_NYD(),mon);

}

~Month(){}

private:

int this_mon;

int days_in_mon;

int start_day;

};

class Date : public Month

{

public:

Date() : Month()

{

this_date = 1;

}

Date(int date,int year,int mon) : Month(year,mon)

{

this_date = date;

}

void Set_Date(int year,int mon,int date)

{

Set_Mon(year,mon);

this_date = date;

}

int Get_date()

{

return this_date;

}

void Print_A_Mon(bool print_all = false)

{

int i;

string str = " ";

if(print_all == false)

{

cout endl;

cout " *********************************" endl;

cout " *********** YEAR " setw(4) Get_year() " ***********" endl;

}

cout " *********************************" endl;

cout " ********* " setw(10) Dig_Mon(Get_Mon()) " ************" endl;

cout " *********************************" endl;

cout " Sun Mon Tue Wed Thu Fri Sat" endl;

for(i = 0;i Get_sd();i++)

cout str;

for(int d = 1;d = Get_Days();d++)

{

i++;

cout setw(5) d;

if(i == 7)

{

cout endl;

i = 0;

}

}

cout endl endl;

}

void PrintAll()

{

cout " *********************************" endl;

cout " ***** Calendar for " Get_year() " *********" endl;

cout " *********************************" endl endl;

for(int i = 0;i 12;i++)

{

Set_Mon(Get_year(),i+1);

Print_A_Mon(true);

}

}

//某天是一年中的第几天

int Day_Pos()

{

int day_pos = 0;

for(int i = 0;i Get_Mon()-1;i++)

{

Set_Date(Get_year(),Get_Mon(),this_date);

day_pos += Get_Days();

}

day_pos += this_date;

return day_pos;

}

int Days_Between(Date ob2)

{

int days_between = 0;

for(int i = Get_year();i ob2.Get_year();i++)

days_between += Days_In_Year(i);

days_between += ob2.Day_Pos();

days_between -= Day_Pos();

return days_between;

}

string What_Day()

{

int day_in_week;

day_in_week = (this_date - 1) % 7 + Get_sd();

if(day_in_week 6)

day_in_week -= 7;

return Dig_Day(day_in_week);

}

~Date(){}

private:

int this_date;

};

#endif

为什么Date类被Calendar类取代了?

使用Java中的Date和Calendar类2008-05-25 21:13Java 语言的Calendar(日历),Date(日期), 和DateFormat(日期格式)组成了Java标准的一个基本但是非常重要的部分. 日期是商业逻辑计算一个关键的部分. 所有的开发者都应该能够计算未来的日期, 定制日期的显示格式, 并将文本数据解析成日期对象. 我们写了两篇文章, 这是第一篇, 我们将大概的学习日期, 日期格式, 日期的解析和日期的计算.

我们将讨论下面的类:

1、具体类(和抽象类相对)java.util.Date

2、抽象类java.text.DateFormat 和它的一个具体子类,java.text.SimpleDateFormat

3、抽象类java.util.Calendar 和它的一个具体子类,java.util.GregorianCalendar

具体类可以被实例化, 但是抽象类却不能. 你首先必须实现抽象类的一个具体子类.

Date 类从Java 开发包(JDK) 1.0 就开始进化, 当时它只包含了几个取得或者设置一个日期数据的各个部分的方法, 比如说月, 日, 和年. 这些方法现在遭到了批评并且已经被转移到了Calendar类里去了, 我们将在本文中进一步讨论它. 这种改进旨在更好的处理日期数据的国际化格式. 就象在JDK 1.1中一样, Date 类实际上只是一个包裹类, 它包含的是一个长整型数据, 表示的是从GMT(格林尼治标准时间)1970年, 1 月 1日00:00:00这一刻之前或者是之后经历的毫秒数.

一、创建一个日期对象

让我们看一个使用系统的当前日期和时间创建一个日期对象并返回一个长整数的简单例子. 这个时间通常被称为Java 虚拟机(JVM)主机环境的系统时间.

import java.util.Date;

public class DateExample1 {

public static void main(String[] args) {

// Get the system date/time

Date date = new Date();

System.out.println(date.getTime());

}

}

在星期六, 2001年9月29日, 下午大约是6:50的样子, 上面的例子在系统输出设备上显示的结果是 1001803809710. 在这个例子中,值得注意的是我们使用了Date 构造函数创建一个日期对象, 这个构造函数没有接受任何参数. 而这个构造函数在内部使用了System.currentTimeMillis() 方法来从系统获取日期.

那么, 现在我们已经知道了如何获取从1970年1月1日开始经历的毫秒数了. 我们如何才能以一种用户明白的格式来显示这个日期呢? 在这里类java.text.SimpleDateFormat 和它的抽象基类 java.text.DateFormat 就派得上用场了.

二、日期数据的定制格式

假如我们希望定制日期数据的格式, 比方星期六-9月-29日-2001年. 下面的例子展示了如何完成这个工作:

import java.text.SimpleDateFormat;

import java.util.Date;

public class DateExample2 {

public static void main(String[] args) {

SimpleDateFormat bartDateFormat =

new SimpleDateFormat("EEEE-MMMM-dd-yyyy");

Date date = new Date();

System.out.println(bartDateFormat.format(date));

}

}

只要通过向SimpleDateFormat 的构造函数传递格式字符串"EEE-MMMM-dd-yyyy", 我们就能够指明自己想要的格式. 你应该可以看见, 格式字符串中的ASCII 字符告诉格式化函数下面显示日期数据的哪一个部分. EEEE是星期, MMMM是月, dd是日, yyyy是年. 字符的个数决定了日期是如何格式化的.传递"EE-MM-dd-yy"会显示 Sat-09-29-01. 请察看Sun 公司的Web 站点获取日期格式化选项的完整的指示.

三、将文本数据解析成日期对象

假设我们有一个文本字符串包含了一个格式化了的日期对象, 而我们希望解析这个字符串并从文本日期数据创建一个日期对象. 我们将再次以格式化字符串"MM-dd-yyyy" 调用SimpleDateFormat类, 但是这一次, 我们使用格式化解析而不是生成一个文本日期数据. 我们的例子, 显示在下面, 将解析文本字符串"9-29-2001"并创建一个值为001736000000 的日期对象.

例子程序:

import java.text.SimpleDateFormat;

import java.util.Date;

public class DateExample3 {

public static void main(String[] args) {

// Create a date formatter that can parse dates of

// the form MM-dd-yyyy.

SimpleDateFormat bartDateFormat =

new SimpleDateFormat("MM-dd-yyyy");

// Create a string containing a text date to be parsed.

String dateStringToParse = "9-29-2001";

try {

// Parse the text version of the date.

// We have to perform the parse method in a

// try-catch construct in case dateStringToParse

// does not contain a date in the format we are expecting.

Date date = bartDateFormat.parse(dateStringToParse);

// Now send the parsed date as a long value

// to the system output.

System.out.println(date.getTime());

}

catch (Exception ex) {

System.out.println(ex.getMessage());

}

}

}

五、使用标准的日期格式化过程

既然我们已经可以生成和解析定制的日期格式了, 让我们来看一看如何使用内建的格式化过程. 方法 DateFormat.getDateTimeInstance() 让我们得以用几种不同的方法获得标准的日期格式化过程. 在下面的例子中, 我们获取了四个内建的日期格式化过程. 它们包括一个短的, 中等的, 长的, 和完整的日期格式.

import java.text.DateFormat;

import java.util.Date;

public class DateExample4 {

public static void main(String[] args) {

Date date = new Date();

DateFormat shortDateFormat =

DateFormat.getDateTimeInstance(

DateFormat.SHORT,

DateFormat.SHORT);

DateFormat mediumDateFormat =

DateFormat.getDateTimeInstance(

DateFormat.MEDIUM,

DateFormat.MEDIUM);

DateFormat longDateFormat =

DateFormat.getDateTimeInstance(

DateFormat.LONG,

DateFormat.LONG);

DateFormat fullDateFormat =

DateFormat.getDateTimeInstance(

DateFormat.FULL,

DateFormat.FULL);

System.out.println(shortDateFormat.format(date));

System.out.println(mediumDateFormat.format(date));

System.out.println(longDateFormat.format(date));

System.out.println(fullDateFormat.format(date));

}

}

注意我们在对 getDateTimeInstance的每次调用中都传递了两个值. 第一个参数是日期风格, 而第二个参数是时间风格. 它们都是基本数据类型int(整型). 考虑到可读性, 我们使用了DateFormat 类提供的常量: SHORT, MEDIUM, LONG, 和 FULL. 要知道获取时间和日期格式化过程的更多的方法和选项, 请看Sun 公司Web 站点上的解释.

运行我们的例子程序的时候, 它将向标准输出设备输出下面的内容:

9/29/01 8:44 PM

Sep 29, 2001 8:44:45 PM

September 29, 2001 8:44:45 PM EDT

Saturday, September 29, 2001 8:44:45 PM EDT

六、Calendar 类

我们现在已经能够格式化并创建一个日期对象了, 但是我们如何才能设置和获取日期数据的特定部分呢, 比如说小时, 日, 或者分钟? 我们又如何在日期的这些部分加上或者减去值呢? 答案是使用Calendar 类. 就如我们前面提到的那样, Calendar 类中的方法替代了Date 类中被人唾骂的方法.

假设你想要设置, 获取, 和操纵一个日期对象的各个部分, 比方一个月的一天或者是一个星期的一天. 为了演示这个过程, 我们将使用具体的子类 java.util.GregorianCalendar. 考虑下面的例子, 它计算得到下面的第十个星期五是13号.

import java.util.GregorianCalendar;

import java.util.Date;

import java.text.DateFormat;

public class DateExample5 {

public static void main(String[] args) {

DateFormat dateFormat =

DateFormat.getDateInstance(DateFormat.FULL);

// Create our Gregorian Calendar.

GregorianCalendar cal = new GregorianCalendar();

// Set the date and time of our calendar

// to the system's date and time

cal.setTime(new Date());

System.out.println("System Date: " +

dateFormat.format(cal.getTime()));

// Set the day of week to FRIDAY

cal.set(GregorianCalendar.DAY_OF_WEEK,

GregorianCalendar.FRIDAY);

System.out.println("After Setting Day of Week to Friday: " +

dateFormat.format(cal.getTime()));

int friday13Counter = 0;

while (friday13Counter = 10) {

// Go to the next Friday by adding 7 days.

cal.add(GregorianCalendar.DAY_OF_MONTH, 7);

// If the day of month is 13 we have

// another Friday the 13th.

if (cal.get(GregorianCalendar.DAY_OF_MONTH) == 13) {

friday13Counter++;

System.out.println(dateFormat.format(cal.getTime()));

}

}

}

}

在这个例子中我们作了有趣的函数调用:

cal.set(GregorianCalendar.DAY_OF_WEEK,

GregorianCalendar.FRIDAY);

和:

cal.add(GregorianCalendar.DAY_OF_MONTH, 7);

set 方法能够让我们通过简单的设置星期中的哪一天这个域来将我们的时间调整为星期五. 注意到这里我们使用了常量 DAY_OF_WEEK 和 FRIDAY来增强代码的可读性. add 方法让我们能够在日期上加上数值. 润年的所有复杂的计算都由这个方法自动处理.

我们这个例子的输出结果是:

System Date: Saturday, September 29, 2001

当我们将它设置成星期五以后就成了: Friday, September 28, 2001

Friday, September 13, 2002

Friday, December 13, 2002

Friday, June 13, 2003

Friday, February 13, 2004

Friday, August 13, 2004

Friday, May 13, 2005

Friday, January 13, 2006

Friday, October 13, 2006

Friday, April 13, 2007

Friday, July 13, 2007

Friday, June 13, 2008

参考资料:

跪求好心人分享Smart Calendar(日程管理软件) V3.2.1软件免费百度云资源

《Smart Calendar(日程管理软件) V3.2.1》百度网盘免费资源下载

链接:

提取码:yffu    

《Smart Calendar(日程管理软件) V3.2.1》语言:英文软件,大小:35.59MB,类别:系统工具

本文标题:go语言日历 go语言诞生时间
地址分享:https://www.cdcxhl.com/article36/dodpgsg.html

成都网站建设公司_创新互联,为您提供外贸网站建设网站建设微信小程序企业建站静态网站网页设计公司

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都做网站