-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJALLog.m
53 lines (38 loc) · 1.79 KB
/
JALLog.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// JALLog.m
// TREA
//
// Created by Joabe Alexandre Leite on 03/09/14.
// Copyright (c) 2014 Andre Ltda. All rights reserved.
//
#import "JALLog.h"
@implementation JALLog
+(NSString *)getStringDataFromDate: (NSDate* ) date{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
// [dateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]];
// [dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss z"];
[dateFormatter setDateFormat:@"dd'-'MM'-'yyyy'"];
// [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSString *dateString = [dateFormatter stringFromDate:date];
return dateString;
}
+(NSString *)getStringHoraFromDate: (NSDate *) date{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
// [dateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]];
[dateFormatter setDateFormat:@"HH:mm:ss"];
// [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSString *dateString = [dateFormatter stringFromDate:date];
// return [dateString stringByAppendingString:[NSString stringWithFormat:@".%@",[self getStringMilisegundos]]];
return dateString;
}
//Retorna o milisegundo da hora atual
+(NSString *) getHoraAtualComMilissegundos{
NSString *temp = [NSString stringWithFormat:@"%.3f", CFAbsoluteTimeGetCurrent()];
NSArray *array = [temp componentsSeparatedByString:@"."];
NSString *ms = [array objectAtIndex:1];
return [NSString stringWithFormat:@"%@:%@", [self getStringHoraFromDate:[NSDate date]], ms];
}
-(NSString *)description{
return [NSString stringWithFormat:@"%@,%@,%d,%d ",_horaImagemString,_horaToqueString, _areaToque, _areaImagem];
}
@end