zoukankan      html  css  js  c++  java
  • nsdate 前一天 后一天

    http://blog.sina.com.cn/s/blog_6568e7880100kfnh.html-(IBAction)prevDay:(id)sender{
        NSDateFormatter *format = [[NSDateFormatter alloc] init];
        [format setDateFormat:@"yyyy-MM-dd"];
        NSString * reportDate = [format stringFromDate:self.m_dataPicker.date];
        NSDate *date = [format dateFromString:reportDate];
        NSDate *newDate = [[NSDate alloc] initWithTimeIntervalSinceReferenceDate:([date timeIntervalSinceReferenceDate] - 24*3600)];
          reportDate = [format stringFromDate:newDate];
        [m_pickerButton setTitle:[[NSString alloc] initWithString:reportDate] forState:UIControlStateNormal];
        [m_dataPicker setDate:newDate animated:NO];
       
        [format release];
    }

    -(IBAction)nextDay:(id)sender{
        NSDateFormatter *format = [[NSDateFormatter alloc] init];
        [format setDateFormat:@"yyyy-MM-dd"];
        NSString *reportDate = [format stringFromDate:self.m_dataPicker.date];
        NSDate *date = [format dateFromString:reportDate];
        NSDate *newDate = [[NSDate alloc] initWithTimeIntervalSinceReferenceDate:([date timeIntervalSinceReferenceDate] + 24*3600)];
           reportDate = [format stringFromDate:newDate];
        
        [m_pickerButton setTitle:[[NSString alloc] initWithString:reportDate] forState:UIControlStateNormal];
        [m_dataPicker setDate:newDate animated:NO];
       
        
        [format release];
    }
  • 相关阅读:
    python2.7 print 中文乱码
    caffe模型转pytorchLSTM
    不同框架下验证精度
    opencv 曲线拟合
    gFlags 测试与使用
    glog 测试与使用
    CBAMConvolutional Block Attention Module
    caffe lstm
    聚合查询和原生数据库操作(18)
    关系映射1(20)
  • 原文地址:https://www.cnblogs.com/moonvan/p/2251642.html
Copyright © 2011-2022 走看看