{"id":21802879,"url":"https://github.com/coderzhuxh/xhdate","last_synced_at":"2025-04-13T18:51:44.407Z","repository":{"id":56927957,"uuid":"88398888","full_name":"CoderZhuXH/XHDate","owner":"CoderZhuXH","description":"时间格式字符串格式化输出为任意格式","archived":false,"fork":false,"pushed_at":"2017-10-23T02:27:50.000Z","size":181,"stargazers_count":23,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T15:10:17.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderZhuXH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-16T07:46:36.000Z","updated_at":"2023-11-29T06:16:30.000Z","dependencies_parsed_at":"2022-08-20T23:30:40.296Z","dependency_job_id":null,"html_url":"https://github.com/CoderZhuXH/XHDate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHDate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHDate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHDate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHDate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderZhuXH","download_url":"https://codeload.github.com/CoderZhuXH/XHDate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248765984,"owners_count":21158296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T11:34:00.070Z","updated_at":"2025-04-13T18:51:44.376Z","avatar_url":"https://github.com/CoderZhuXH.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### 时间字符串转换为任意格式显示\n_____________________________\n\n[![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?maxAge=2592000)](https://github.com/CoderZhuXH/XHDate)\n[![Version Status](https://img.shields.io/cocoapods/v/XHDate.svg?style=flat)](http://cocoadocs.org/docsets/XHDate)\n[![Support](https://img.shields.io/badge/support-iOS%207%2B-brightgreen.svg)](https://github.com/CoderZhuXH/XHDate)\n[![Pod Platform](https://img.shields.io/cocoapods/p/XHDate.svg?style=flat)](http://cocoadocs.org/docsets/XHDate/)\n[![Pod License](https://img.shields.io/cocoapods/l/XHDate.svg?style=flat)](https://github.com/CoderZhuXH/XHDate/blob/master/LICENSE)\n\n### 特性:\n\n*   1.支持时间格式字符串转换为任意格式时间\n*   2.例如:2017-04-16 13:08:06 支持转换为以下格式\u003cbr\u003e\n    星期几\u003cbr\u003e\n    2017年04月16日\u003cbr\u003e\n    2017年04月\u003cbr\u003e\n    04月16日\u003cbr\u003e\n    2017年\u003cbr\u003e\n    13时08分01秒\u003cbr\u003e\n    13时08分\u003cbr\u003e\n    08分01秒\u003cbr\u003e\n    2017-04-16\u003cbr\u003e\n    2017-04\u003cbr\u003e\n    04-16\u003cbr\u003e\n    2017\u003cbr\u003e\n    13:08:06\u003cbr\u003e\n    13:08\u003cbr\u003e\n    08:06\u003cbr\u003e\n\n### 技术交流群(群号:537476189).\n\n## 效果\n\n![demo](https://github.com/CoderZhuXH/XHDateExample/blob/master/Demo.png)\n\n## 使用方法\n\n导入 #import \"NSString+XHDateFormat.h\" 直接掉用下面方法转换为需要格式\n\n```objc\n\n\n    self.timeString = @\"2017-04-16 13:08:06\";\n    \n    //星期\n    NSString *time0 = self.timeString.xh_formatWeekDay;\n    \n    //2017年04月16日\n    NSString *time1 = self.timeString.xh_formatNianYueRi;\n    \n    //2017年04月\n    NSString *time2 = self.timeString.xh_formatNianYue;\n    \n    //04月16日\n    NSString *time3 = self.timeString.xh_formatYueRi;\n    \n    //2017年\n    NSString *time4 = self.timeString.xh_formatNian;\n\n    //13时08分01秒\n    NSString *time5 = self.timeString.xh_formatShiFenMiao;\n    \n    //13时08分\n    NSString *time6 = self.timeString.xh_formatShiFen;\n    \n    //08分01秒\n    NSString *time7 = self.timeString.xh_formatFenMiao;\n    \n    //2017-04-16\n    NSString *time8 = self.timeString.xh_format_yyyy_MM_dd;\n    \n    //2017-04\n    NSString *time9 = self.timeString.xh_format_yyyy_MM;\n    \n    //04-16\n    NSString *time10 = self.timeString.xh_format_MM_dd;\n    \n    //2017\n    NSString *time11 = self.timeString.xh_format_yyyy;\n    \n    //13:08:06\n    NSString *time12 = self.timeString.xh_format_HH_mm_ss;\n    \n    //13:08\n    NSString *time13 = self.timeString.xh_format_HH_mm;\n    \n    //08:06\n    NSString *time14 = self.timeString.xh_format_mm_ss;\n\n```\n\n##  安装\n### 1.手动添加:\u003cbr\u003e\n*   1.将 XHDate 文件夹添加到工程目录中\u003cbr\u003e\n*   2.导入 XHDate.h\n\n\n##  系统要求\n*   该项目最低支持 iOS 7.0 和 Xcode 7.0\n\n##  许可证\nXHDate 使用 MIT 许可证，详情见 LICENSE 文件\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderzhuxh%2Fxhdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderzhuxh%2Fxhdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderzhuxh%2Fxhdate/lists"}