E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
NSDate
认识Tagged Pointer
前言:苹果从64bit开始,iOS就引入了TaggedPointer技术,用于优化NSNumber,
NSDate
,NSString等小对象的存储。
熊啊熊啊熊
·
2023-08-25 01:52
ios 字符串比较 日期比较
stringcompare:otherString]==NSOrderedAscending){NSLog(@"我比你大");}else{NSLog(@"我是小三");}日期比较12345678//日期比较
NSDate
Wally1985
·
2023-08-25 01:20
iOS开发小技巧--userdefault存储复杂数据(image为例)
比如用户id用户的登录token什么的这种比较短小的数据2.NSUserDefaults支持的数据格式有:NSNumber、NSData、
NSDate
、NSString、NSArray、NSDictionary
玄_子午
·
2023-08-23 16:03
iOS开发计算两个时间戳的时间差
dateNSDateFormatter*formatter=[[NSDateFormatteralloc]init];formatter.dateFormat=@"yyyy-MM-ddHH:mm:ss";
NSDate
此笙吥涣
·
2023-08-23 03:31
判断时间是否今天明天后天
enum{Sun=1,Mon,Tue,Wed,Thu,Fri,Sat};-(NSString*)dateToStr:(
NSDate
*)date{NSString*flagString=nil;//当前日期
elephant0001
·
2023-08-16 03:39
iOS Tagged Pointer 类型是啥?
一、介绍从64bit开始,iOS引入了TaggedPointer技术,用于优化NSNumber、
NSDate
、NSString等小对象的存储。
搬砖小工
·
2023-08-07 10:15
iOS 日期与字符串格式互转
-(void)viewDidLoad{[superviewDidLoad];
NSDate
*nowDate=[NSDatedate];NSString*str=[selfdateToString:nowDatewithDateFormat
清风_____
·
2023-08-06 20:51
iOS——json13位时间戳转换时间格式
/***Since1970*/+(NSString*)getNewDate:(NSString*)dateStr{
NSDate
*date=[NSDatedateWithTimeIntervalSince1970
疯狂战斗狮
·
2023-08-05 08:39
OC
Tool
ios
objective-c
ios 计算当前时间与某一个时间相隔天数
-(NSInteger)getDifferenceByDate:(NSString*)date{//获得当前时间
NSDate
*now=[NSDatedate];//实例化一个NSDateFormatter
elephant0001
·
2023-07-28 19:11
iOS 时间以及时间戳的各种方法
NSDateFormatter*pFormatter=[[NSDateFormatteralloc]init];[pFormattersetDateFormat:@"yyyy-MM-ddHH:mm:ss"];
NSDate
NirvanaReborn凯
·
2023-07-28 02:38
时间的判断
-(BOOL)isDate:(
NSDate
*)date1inSameDayAsDate:(
NSDate
*)date2-(BOOL)isDateInToday:(
NSDate
*)date;//判断一个日期是否是今天
东部落的太阳
·
2023-07-27 04:13
ios序列化
NSUserDefaults只支持:NSString,NSNumber,
NSDate
,NSArray,NSDictionary.如果把一个自定义的类存到一个NSArray里,然后再存到NSUser
stan_fei
·
2023-07-25 04:35
ios
NSDate
格式字符串说明
iOS-NSDateFormatter格式说明(转载)格式化参数如下:G:公元时代,例如AD公元yy:年的后2位yyyy:完整年MM:月,显示为1-12MMM:月,显示为英文月份简写,如JanMMMM:月,显示为英文月份全称,如Janualydd:日,2位数表示,如02d:日,1-2位显示,如2EEE:简写星期几,如SunEEEE:全写星期几,如Sundayaa:上下午,AM/PMH:时,24小时
架构师的一小步
·
2023-07-22 02:37
内存管理 Tagged Pointer
从64bit开始,iOS引入了TaggedPointer技术,用于优化NSNumber、
NSDate
、NSString等小对象的存储在没有使用Tagged
TaoGeNet
·
2023-07-17 06:48
iOS 判断某个时间距离当天间隔几天
方法一:-(NSInteger)getDifferenceByDate:(
NSDate
*)oldDate{//获得当前时间
NSDate
*now=[NSDatedate];NSCalendar*gregorian
jazzfly
·
2023-07-16 23:27
iOS获取当前日期的前n个月或后n个月时间
很简单,记录一下-(NSString*)beforeDate:(NSInteger)n{
NSDate
*currentDate=[NSDatedate];NSDateFormatter*formatter
DockeriOS
·
2023-07-16 13:31
关于时间戳
NSDate
*datenow=[NSDatedate];NSLog(@"datenow=%@",datenow);文档如下Createsandreturnsanewdatesettothecurrentdateandtime.Anewdateobjectsettothecurrentdateandtim
不知道为什么
·
2023-06-19 05:54
NSDate
、CACurrentMediaTime的区别
NSDate
属于Foundation。
NSDate
或CFAbsoluteTimeGetCurrent()返回的时钟时间将会会网络时间同步。
梵生
·
2023-06-15 22:01
在保存数据的时候出现reason: 'Attempt to insert non-property list object null for key **
其中NSUserDefaults支持的数据类型有NSString、NSNumber、
NSDate
、NSArray、NSDictionary、BOOL、NSInteger、NSFloa
西贝人立口
·
2023-06-15 16:59
获取本月的第一天和最后一天
NSString*)dateStr{NSDateFormatter*format=[[NSDateFormatteralloc]init];[formatsetDateFormat:@"yyyy-MM"];
NSDate
一笑wangx
·
2023-06-13 05:50
ios 两个时间差多少天时分
计算两个时间差:NSDateFormatter*date=[[NSDateFormatteralloc]init];[datesetDateFormat:@"yyyy/MM/ddHH:mm:ss"];
NSDate
丶王无情
·
2023-06-12 13:31
时间
NSDate
分类整理
以前新工作在做邮箱app项目,里面新做了一个日程模块,用了很多日期出来分类,有很多对日期特殊处理.这里贡献出来.日期处理特别需要处理的是尽量用系统的类,不要转成日期字符串再比较,日期转字符串特别耗费性能.//是否是一周内的时间7天内-(BOOL)isWeak{NSCalendar*calendar=[NSCalendarcurrentCalendar];NSDateComponents*cmps=
江水东流
·
2023-06-10 05:22
iOS编程的对象模型化存储LKDBHelper
LKDBHelper要求:仅限ARCFMDBpod'LKDBHelper'全面支持NSArray,NSDictionary,ModelClass,NSNumber,NSString,
NSDate
,NSData
单线程Jack
·
2023-06-08 06:19
根据时间排序一列json数组
1.获取两个数组时间的字符串,转成时间格式比较大小[(
NSDate
*)compare:(
NSDate
*)]2.根据时间大小排序此数组sortedArrayUsingComparator(NSMutableArray
彩虹下的笑颜
·
2023-04-19 16:33
获取某一刻的时间
/***传入时间,返回那时候的时间戳比如今天或者明天12点的时间戳*/+(NSInteger)my_getFarFrom_12_TimeWithTime:(NSInteger)time{
NSDate
*date
eryuxinling
·
2023-04-18 19:05
Realm使用
.h文件@interfacePerson:RLMObject/**Realm支持的数据类型BOOL、int、NSInteger、long、longlong、float、double、NSString、
NSDate
Mr_Shaozj
·
2023-04-18 13:58
iOS 获取N天前或N天后日期中的坑
最常见获取N天前后的日期的方法是://获取N天后日期+(
NSDate
*)getDate:(
NSDate
*)currentDateday:(NSInteger)day{NSIntegerdays=day;
萨瓦迪卡123456
·
2023-04-16 03:29
关于
NSDate
的那些事儿
@interfaceViewController(){NSString*_dateString;//时间戳}@end-(void)viewDidLoad{[superviewDidLoad];//1.获取到当前时区的当前时间[selfgetCurrentDateOfLocalZone];//2.获取当前时间戳//时间戳是指格林威治时间1970年01月01日00时00分00秒起至现在的总秒数[sel
YJLJianShu
·
2023-04-14 21:11
c++学习总结:获取13位系统时间戳
2019独角兽企业重金招聘Python工程师标准>>>在iOS中使用
NSDate
来处理时间相关的操作,这在iOS客户端开发中非常方便。
weixin_34218579
·
2023-04-14 18:35
c/c++
移动开发
python
// 获取当前日期
(
NSDate
*)getCurrentDate{//设置想要的格式NSDateFormatter*formatter=[[NSDateFormatteralloc]init];[formattersetDateStyle
魏志军
·
2023-04-10 06:00
Objective-C的
NSDate
学习笔记
NSDate
-日期类
NSDate
是Foundation框架中表示日期的类,用于保存时间值的一个OC类,
NSDate
对象封装了一个时间点,独立于任何特定的日历系统或时区。
寻心_0a46
·
2023-04-09 22:13
数据处理
getWeekBegin{return[[NSDategetMonthBeginAndEnd:self]objectForKey:@"begin"];}+(NSString*)getWeekBegin:(
NSDate
kled_net
·
2023-04-09 18:17
iOS YYYY 和 yyyy的区别
如果一月1日是星期五,星期六或星期日,它在前一年的52周或53周使用yyyy时间
NSDate
*currentDateTime=[NSDatedate];NSDateFor
海耐射手
·
2023-04-08 10:10
获取对应月的第一天日期或者最后一天日期
//获取日期date对应月的第一天日期//获取日期date对应月的最后一天日期+(NSString*)getMonthFirstDayWithDate:(
NSDate
*)dateformat:(NSString
东部落的太阳
·
2023-04-08 05:33
ios
NSDate
NSTring long 时间戳与字符串转换
NSStringstringWithFormat:@"%d",(long)[localeDatetimeIntervalSince1970]];NSLog(@"timeSp:%@",timeSp);//时间戳的值二,把获取的时间转化为当前时间
NSDate
最炫名族风
·
2023-04-06 08:02
ios
nsstring
ios
计算
NSDate
之间相差的秒数(时间差)
https://blog.csdn.net/liufangbaishi2014/article/details/49741907
布谷布谷7788
·
2023-04-05 11:00
iOS 关于时间的一些操作
1、基本时间日历//1、获取当前时间
NSDate
*now=[NSDatedate];NSDateFormatter*nowFormate=[[NSDateFormatteralloc]init];nowFormate.dateFormat
luxing123
·
2023-04-03 21:25
IOS 判断当前时间是否出于某个时间段内
paramendTime结束时间*/-(BOOL)validateWithStartTime:(NSString*)startTimewithExpireTime:(NSString*)endTime{
NSDate
本客
·
2023-03-31 08:49
iOS 字符串转换为时间
dateFormatter=[[NSDateFormatteralloc]init];//需要设置为和字符串相同的格式[dateFormattersetDateFormat:@"yyyyMMdd"];
NSDate
一颗熊的自由时光
·
2023-03-28 03:54
iOS一些常用的工具类
//获取当前时间戳有两种方法(以秒为单位)//获取当前时间戳有两种方法(以秒为单位)+(NSString*)getNowTimeTimestampWithNowDate:(
NSDate
*)nowDate
何色相撩我心弦
·
2023-03-27 15:48
获取当前时间及时间戳的互换
1.获取年月日时分秒实现代码:
NSDate
*date1=[NSDatedate];NSDateFormatter*formatter1=[[NSDateFormatteralloc]init];[formatter1setDateStyle
小孩仔
·
2023-03-26 18:44
Tagged Pointer
介绍1、从64bit开始,iOS引入了TaggedPointer技术,用于优化NSNumber、
NSDate
、NSString等小对象的存储2、在没有使用TaggedPointer之前,NSNumber
上帝不在服务区
·
2023-03-24 20:14
获取对应日期是周几
//获取对应日期是周几+(NSInteger)getWeekDayFromDate:(
NSDate
*)date{NSArray*tempWeek=@[@"7",@"1",@"2",@"3",@"4",@
东部落的太阳
·
2023-03-24 19:38
不要傻傻地以为 [
NSDate
date] 就是北京时间
NSDateFormatter*formatter=[[NSDateFormatteralloc]init];NSTimeZone*timeZone=[NSTimeZonetimeZoneForSecondsFromGMT:8*60*60];[formattersetTimeZone:timeZone];[formattersetDateFormat:@"yyyy-MM-ddHH:mm:ss"];
无情酱油
·
2023-03-21 03:01
计算2个时间 相差分钟数
+(NSString*)getTimeDiffString:(NSTimeInterval)timestamp{NSCalendar*cal=[NSCalendarcurrentCalendar];
NSDate
呦嚯嚯嚯12138
·
2023-03-20 08:34
时间戳
一.关于[NSDatedate]的问题
NSDate
*date=[NSDatedate];NSLog(@"date时间=%@",date);初始化一个
NSDate
时间[NSDatedate],获取的是零时区的时间
风火连城
·
2023-03-18 03:08
iOS内存管理方案
iOS内存管理方案:由以下三种方案结合TaggedPointer(64位系统)储存NSNumber以及
NSDate
等类型,以节省内存及提高效率,指针不指向任何地址,指针由标识+值构成NONPOINTER_ISA
Shineyok
·
2023-03-15 13:27
iOS内存管理
memory.png针对不同场景的内存管理方案:TaggedPointer:针对小型数据,如NSNumber、
NSDate
。
三分慢先森
·
2023-03-14 06:13
将包含am和pm的字符串到
NSDate
所遇到的问题
将NSString转换为
NSDate
,但是用下面的代码实现后,只有用户的设备时间在12小时制时才有效,24小时制的时候转换后的结果为nil。
mark666
·
2023-03-13 06:11
iOS数据测试
dosomethingCFAbsoluteTimeend=CFAbsoluteTimeGetCurrent();NSLog(@"%f",end-start);iOS获取当前时间戳单位:ms-(NSString*)currentTimeStr{
NSDate
Mr_lk先生
·
2023-03-12 17:43
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他