当前位置: 首页 > news >正文

温州企业建站程序西安网络公司

温州企业建站程序,西安网络公司,网站制作里面链接怎么做,网站建设 博采网络1、NSDate 时间与日期的初始化,主要有 [NSDate date]; 2、NSDateFormatter 主要用于NSString和Date之间相互转化//NSDate转NSStringstringFromDate:dt//NSString转NSDatedateFromString 3、NSCalendar和NSDateComponents Date打印出具体时间的年月日和把年月日转化为Date4、N…1、NSDate 时间与日期的初始化,主要有 [NSDate date]; 2、NSDateFormatter 主要用于NSString和Date之间相互转化//NSDate转NSStringstringFromDate:dt//NSString转NSDatedateFromString 3、NSCalendar和NSDateComponents Date打印出具体时间的年月日和把年月日转化为Date4、NSTimer 定时器(NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocation *)invocation repeats:(BOOL)yesOrNo;(NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocation *)invocation repeats:(BOOL)yesOrNo; (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(nullable id)userInfo repeats:(BOOL)yesOrNo;(NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(nullable id)userInfo repeats:(BOOL)yesOrNo; 5、测试Demo main.m文件 int main(int argc, char * argv[]) {autoreleasepool {//NSDate常用方法NSDate *date [NSDate date];NSLog(%, date);NSDate *date1 [[NSDate alloc] initWithTimeIntervalSinceNow:3600 * 24];NSLog(date1 is %, date1);NSDate *date2 [[NSDate alloc] initWithTimeIntervalSinceNow:-3 * 3600 * 24];NSLog(date1 is %, date2);NSLocale *cn [NSLocale currentLocale];NSLog(%, [date1 descriptionWithLocale:cn]);NSLog(%, [date1 earlierDate:date2]);//NSDate转NSStringNSDate *dt [NSDate dateWithTimeIntervalSince1970:3600 * 24 * 366 * 20];NSDate *dt1 [NSDate dateWithTimeIntervalSince1970:0];NSLog(%, dt1);NSDateFormatter *df [[NSDateFormatter alloc] init];[df setDateFormat:公元yyyy年MM月DD日 HH时mm分];NSLog(%, [df stringFromDate:dt]);//NSString转NSDateNSString *str 2018-03-02;NSDateFormatter *df1 [[NSDateFormatter alloc] init];[df1 setDateFormat:yyyy-MM-dd];NSLog(%, [df1 dateFromString:str]);//NSCalendar和NSDateComponents使用NSCalendar *car [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];NSDate *date3 [NSDate date];unsigned unit NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekdayCalendarUnit;NSDateComponents *comp [car components:unit fromDate:date3];NSLog(现在是%ld年, comp.year);NSLog(现在是%ld月, comp.month);NSLog(现在是%ld日, comp.day);NSLog(现在是%ld时, comp.hour);NSLog(现在是%ld分, comp.minute);NSLog(现在是%ld秒, comp.second);NSLog(现在是星期%ld, comp.weekday);NSDateComponents *comp1 [[NSDateComponents alloc] init];comp1.year 2015;comp1.month 4;comp1.day 5;comp1.hour 18;comp1.minute 34;NSDate *date4 [car dateFromComponents:comp1];NSLog(date is %:, date4);return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));} } ViewControl.m文件(这里实现的定时器) implementation ViewController- (void)viewDidLoad {[super viewDidLoad]; // Control *control [Control new]; // control.delegate self; // [control willShowAlert];NSTimer* timer [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:selector(Timered:) userInfo:nil repeats:YES]; }- (void)Timered:(NSTimer*)timer {NSLog(hello chenyu); } end 6、运行的结果 2018-07-12 23:03:31.6348700800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:32.6349150800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:33.6348810800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:34.6349380800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:35.6349980800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:36.6350950800 cyTest[37918:6787840] hello chenyu 2018-07-12 23:03:37.6350860800 cyTest[37918:6787840] hello chenyu2018-07-12 23:14:23.7896400800 cyTest[38218:6796894] Thu Jul 12 23:14:23 2018 2018-07-12 23:14:23.7908440800 cyTest[38218:6796894] date1 is Fri Jul 13 23:14:23 2018 2018-07-12 23:14:23.7914920800 cyTest[38218:6796894] date1 is Mon Jul 9 23:14:23 2018 2018-07-12 23:14:23.8045980800 cyTest[38218:6796894] Friday, July 13, 2018 at 11:14:23 PM China Standard Time 2018-07-12 23:14:23.8048530800 cyTest[38218:6796894] Mon Jul 9 23:14:23 2018 2018-07-12 23:14:23.8053460800 cyTest[38218:6796894] Thu Jan 1 08:00:00 1970 2018-07-12 23:14:23.8059270800 cyTest[38218:6796894] 公元1990年01月16日 08时00分 2018-07-12 23:14:23.8083300800 cyTest[38218:6796894] Fri Mar 2 00:00:00 2018 2018-07-12 23:14:23.8089820800 cyTest[38218:6796894] 现在是2018年 2018-07-12 23:14:23.8091500800 cyTest[38218:6796894] 现在是7月 2018-07-12 23:14:23.8093540800 cyTest[38218:6796894] 现在是12日 2018-07-12 23:14:23.8095580800 cyTest[38218:6796894] 现在是23时 2018-07-12 23:14:23.8096840800 cyTest[38218:6796894] 现在是14分 2018-07-12 23:14:23.8098340800 cyTest[38218:6796894] 现在是23秒 2018-07-12 23:14:23.8104070800 cyTest[38218:6796894] 现在是星期5 2018-07-12 23:14:23.8112110800 cyTest[38218:6796894] date is Sun Apr 5 18:34:00 2015: 2018-07-12 23:14:27.7646330800 cyTest[38218:6796894] hello chenyu 2018-07-12 23:14:28.7647580800 cyTest[38218:6796894] hello chenyu 2018-07-12 23:14:29.7657760800 cyTest[38218:6796894] hello chenyu 2018-07-12 23:14:30.7657920800 cyTest[38218:6796894] hello chenyu 2018-07-12 23:14:31.7654260800 cyTest[38218:6796894] hello chenyu
http://www.pierceye.com/news/37208/

相关文章:

  • 西安双语网站建设长沙网站建设公司招聘
  • 泉州网站建设-泉州网站建设公司做神马网站优
  • 江苏建设人才网网站网站建设有什么技术
  • 西安网站制作定制杭州企业自助建站
  • 电子商务网站建设期末试题织梦模板大全
  • led灯 东莞网站建设济南建站公司电话
  • 如何搭建网站教程视频网件路由器r7000
  • 沈阳酒店企业网站制作公司沈阳网站建设发布
  • 网站建设具体建设流程摄影设计说明
  • 支付功能网站建设百度网页高级搜索
  • 商城网站开发平台海南网站建设小强
  • 网站架构分析购物网站的功能板块
  • 网站注册 英文手机上自己设计房子软件
  • 营销型网站搭建的工作网站开发模块
  • 一个空间放2个网站北京网站建设公司案例
  • 餐厅网站建设什么线上推广引流平台
  • 佛山小企业网站建设秦皇岛建设路小学网站
  • 徐州教育平台网站建设可以做翻译兼职的网站
  • 怎么把危险网站wordpress做简单的商城
  • 企业网站策划书1000字中国跨境电商出口平台
  • 做汽车商城网站网站如何做定级备案
  • 怎么注册自己的网站域名辽宁建设工程信息网评定分离规则
  • 网站建设应该懂什么知识proxy网站
  • 广东省建设信息网站做网站的工资高
  • 哪个网站做动图网站底部样式
  • 贵阳中企动力做的网站英文wordpress 安装
  • wordpress全站开启ssl住房和城乡建设部执法网站
  • 网页设计素材网站推荐做网站销售是干什么的
  • 工 投标做哪个网站好域名注册了是永久的吗
  • 黑龙江建设人员证件查询网站wordpress主题源码