Skip to main content
-1 votes
1 answer
70 views

I received a date string and a timezone from a web service and I am needing to convert into an NSDate. When setting the format and timezone, I get nil: NSString *timeZoneString = @"Europe/Paris&...
Nic Hubbard's user avatar
  • 42.3k
3 votes
3 answers
385 views

I'm trying to set the seconds of a date object to 0 with the following: if let date = value{ var calendar = Calendar.current if let mdate = calendar.date(bySetting: .second, value: 0, of: date) ...
Charlie Walker's user avatar
0 votes
3 answers
190 views

I'm using this code to convert HH:mm string to GMT time string HH:mm: func convertToGMT(timeString: String) -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "...
YosiFZ's user avatar
  • 7,920
-1 votes
1 answer
192 views

I am trying to solve my issue with a Unix Timestamp. I figured out how to present it but the result is too long - it says: "Friday March 31, 2023 at 11:13:52 PM Central European Summer Time" ...
alancord's user avatar
1 vote
0 answers
1k views

I have the following code let dateFormatter = ISO8601DateFormatter() dateFormatter.formatOptions.insert(.withFractionalSeconds) decoder.dateDecodingStrategy = .custom({ decoder in ...
erotsppa's user avatar
  • 14.7k
1 vote
1 answer
48 views

I am trying to convert DateString into Different DateFromat. strDate = @"24-08-2022 06:38:50 +0:00" NSDateFormatter *dateformate = [[NSDateFormatter alloc] init]; [...
Parth's user avatar
  • 19
0 votes
0 answers
17 views

I need to convert this date string to a date object. This is the format that youtube API sends for a published at date. 2022-10-26T02:40:04.645878Z let all_time_date = "2022-10-26T02:40:04....
husharoonie's user avatar
0 votes
0 answers
760 views

I have to display date and time in an iOS app based on locale (Region) and time format (24-Hour vs 12-Hour) set in the device Settings app. I am using below code for the same :- class func ...
letsbondiway's user avatar
-1 votes
2 answers
2k views

I have a date as String but I want to convert it to Date. The date in string looks like this - "2022-09-09T07:00:00.0000000". Code to convert it to Date: public static func dateStringToDate(...
tech_human's user avatar
  • 7,202
0 votes
1 answer
59 views

I have a date string in this format: 2022-09-07T11:11:16+0300 and I want to convert it to NSDate and back again to NSString, I use this code: NSString * dateCreatedString = @"2022-09-07T11:11:16+...
YosiFZ's user avatar
  • 7,920
1 vote
1 answer
2k views

I've looked around and people have had problems with different years, random and changing results, and nil dates, but nothing like what I have, so I am asking here. Note I am in Playground right now. ...
Ben's user avatar
  • 1,427
-1 votes
2 answers
102 views

I am using date picker in my application. After selects particular date, It's not able to converting to required format. Datepicker date: 2021-07-21 13:53:38 +0000 expected format 21 July 2021 I ...
Anilkumar iOS Developer's user avatar
0 votes
1 answer
89 views

How can I get a Date object that matches a given time in a given time zone? For example, I want to get the Date that represents the next 3AM CST. I thought of this, but I'm not sure if it's the best ...
Eric's user avatar
  • 849
0 votes
1 answer
235 views

Why is dateRemainingText2 giving different result from dateRemainingText? Obviously dateRemainingText2 is wrong. Here's my code: import Foundation let startDate = Calendar.current.date(from: ...
user14119170's user avatar
  • 1,971
1 vote
1 answer
607 views

Here's my code: let startDate = Calendar.current.date(from: DateComponents(year: 2022, month: 5, day: 1)) ?? .now let endDate = Calendar.current.date(from: DateComponents(year: 2020, month: 6, day: 2))...
user14119170's user avatar
  • 1,971

15 30 50 per page
1
2 3 4 5
323