NSString to NSDate for yyyy-MM-dd'T'HH:mm:ss.SSS+05:30 format

后端 未结 5 1072
一向
一向 2021-01-01 21:52

My date string that I am getting is 2014-01-08T21:21:22.737+05:30 of this format. How do i confer it to NSDate?

I tried:

       NSString *currentDate         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 22:45

    Set your dateFormat as

    [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ"];
    

    And Yes, Now NSLog is Printing a specific Date.!!!

    Enjoy Coding

提交回复
热议问题