//
//  NSDate+currentDate.h
//  RDSmartPlug
//
//  Created by Rayson on 2020/5/28.
//  Copyright © 2020 RDIOT. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDate (currentDate)

+ (NSDate *)currentDate;

// 时间戳—>字符串时间 HH:mm:ss
+ (NSString *)rds_timeStringFromTimestamp:(NSString *)timestamp;

// NSDate—>字符串时间 HH:mm
+ (NSString *)rds_timeStringFromNSDate:(NSDate *)date;

/// 1.14 星期六
+ (NSString *)rds_getDayString;

/// 字符串时间 HH:mm  转date
+ (NSDate *)rds_dateFromTimeString:(NSString *)timeString;

// 时间戳—>NSDate
+ (NSDate *)rds_dateFromTimestamp:(NSString *)timestamp;

// 是否同一天
+ (BOOL)isSameDay:(NSDate *)date1 date2:(NSDate *)date2;

+ (BOOL)isSameMinute:(NSDate *)date1 date2:(NSDate *)date2;

+ (BOOL)isDateInToday:(NSDate *)date;


// 获取时间戳
+ (NSString *)rds_getTimestamp:(NSDate *)date;
// 零点时间戳
+ (NSString *)rds_getZeroTime:(NSDate *)date;
// 最后一秒时间戳
+ (NSString *)rds_getEndTime:(NSDate *)date;

// 当月1号
+ (NSDate *)rds_firstDayOfMonth:(NSDate *)date;
// 当月最后一天
+ (NSDate *)rds_lastDayOfMonth:(NSDate *)date;

// 当月有多少天
+ (NSInteger)countThisMonthDays:(NSDate *)date;



/// 相对时间（凌晨00:00）的分钟数
- (NSString *)rds_getMinute;

/// 分钟数转时间
+ (NSString *)rds_getTimeStringFromMinute:(NSString *)min;
@end

NS_ASSUME_NONNULL_END
