Skip to content

Instantly share code, notes, and snippets.

@liulunet
liulunet / NSDate+DateFormat.m
Last active August 29, 2015 14:14
NSDateFormat
-(NSMutableDictionary*)dateDictionary
{
NSCalendar * chineseCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSUInteger unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit |
NSSecondCalendarUnit | NSDayCalendarUnit |
NSMonthCalendarUnit | NSYearCalendarUnit;
NSDateComponents * cps = [chineseCalendar components:unitFlags fromDate:self];
NSUInteger hour = [cps hour];
NSUInteger minute = [cps minute];
@liulunet
liulunet / Convert.h
Created January 9, 2015 09:57
Geodetic System WGS-84==>GCJ-02<==>BD-09
// derived from https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936
#ifndef coordinate_convert_h
#define coordinate_convert_h
#include <math.h>
const double pi = 3.14159265358979324;