dateformatter Questions

3

Solved

I wrote the following code to show a datetime in a particular format: let formatter = NSDateFormatter() formatter.dateStyle = NSDateFormatterStyle.LongStyle formatter.timeStyle = .MediumStyle form...
Isogamete asked 17/7, 2015 at 5:53

3

Solved

I want to show a date as Saturday June 13. If the date is current day it should display Today like that Tomorrow, Yesterday. I couldn't achieve both. guard let date = Date(fromString: "16 Sept...
Defant asked 16/9, 2020 at 7:16

2

Solved

Was only able to reproduce this issue on a friend's device. The device is from Germany and is set to the German region in Settings. I cannot reproduce on any Canadian devices. Why is it failing whe...
Ligure asked 4/2, 2022 at 22:30

3

Solved

I am developing using Java 8 a function that must handle the conversion from String to LocalDateTime of the following dates: 2019-06-20 12:18:07.207 +0000 UTC 2019-06-20 12:18:07.20 +0000 UTC 201...
Dalury asked 19/8, 2019 at 8:50

6

Solved

Here is my method to parse String into LocalDateTime. public static String formatDate(final String date) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS"); L...

0

Updated iPad to iOS 15.4. Now String to Date conversion using DateFormatter returns nil when stored month format "MMM" = Sep. Works ok when MMM Month = Sept. Did work in iOS 15.3 and earl...
Bullhorn asked 20/3, 2022 at 7:35

8

In the images below you can see the code I wrote and the values of all the variables: class fun getCurrentShortDate() -> String { var todaysDate = NSDate() var dateFormatter = NSDateFormatter...
Pantelleria asked 4/2, 2015 at 22:41

1

Solved

Do you know how I could have the following date string Jun 28 on iOS? Jun 28 in English 28 juin in French etc I want basically short month, day, without year. (in the localized order, so day, mon...
Chaplet asked 28/6, 2020 at 18:47

1

Solved

I don't understand something, I have this code : DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); System.out.println(LocalDateTime.parse(LocalDateTime.now().format(f...
Fishback asked 5/6, 2020 at 8:30

4

Solved

I am replacing my old JSON parsing code with Swift's Codable and am running into a bit of a snag. I guess it isn't as much a Codable question as it is a DateFormatter question. Start with a struct...
Annoying asked 27/9, 2017 at 23:2

3

Solved

It's been a long day and my brain is tired so maybe I'm completely missing something, but how come when I run this line, System.out.println( DateTimeFormatter.ofPattern("YYYYMMdd") .withZo...
Diabetic asked 15/1, 2020 at 22:4

3

Solved

I have the following string: String timeStamp = "2020-01-31 12:13:14 +03:00". And I tried to parse it using Java 8 DateTimeFormatter. DateTimeFormatter formatter = DateTimeFormatter.ofPattern( for...
Adahadaha asked 9/4, 2019 at 18:50

1

Solved

I cannot find a list of the format specifiers allowed in the template argument of DateFormatter.dateFormat(fromTemplate:options:locale:). dateFormat directs me to... Date and Time Programming Gui...
Dreeda asked 10/3, 2019 at 18:57

3

Solved

I am using DateTimeFormatter to format date: ZonedDateTime date = ZonedDateTime.parse("2015-12-03T18:15:30+01:00[America/New_York]"); DateTimeFormatter formatter = DateTimeFormatter.ofLocalized...
Halsy asked 3/1, 2019 at 3:28

1

I want to create a date string from two dates in format like : "Apr 21 - Sep 17, 2018" - US "21 Apr - 17 Sep, 2018" - Elsewhere While respecting local date formats (MMM dd for US, dd MMM for Eur...
Plating asked 10/7, 2018 at 14:2

2

Solved

I have a issue with getting the correct date in the following case let dateString = "May 2, 2018 at 3:31 PM" let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MMM dd, yyyy 'at' HH:mm...
Gottfried asked 2/5, 2018 at 21:6

1

Solved

If your iOS device is set to use a region that defaults to 12 hour time (e.g. United States) and you have a DateFormatter set up like this: var dateFormatter: DateFormatter = { let formatter = Dat...
Blynn asked 19/4, 2018 at 18:53

1

Solved

I want convert this: Dec 31, 2017 8:00:00 PM to dd-mm-yyyy HH:ii format in Swift 4. This is my code so far: let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MMM dd, yyyy hh:mm:ss ...
Theisen asked 22/12, 2017 at 12:57

1

Solved

extension Formatter { static let iso8601: DateFormatter = { let formatter = DateFormatter() formatter.calendar = Calendar(identifier: .iso8601) formatter.timeZone = TimeZone.init(identifier: "A...
Wayzgoose asked 10/10, 2017 at 5:26

3

Solved

This is the date formatter setup: let dateFormatter = DateFormatter() dateFormatter.dateStyle = .medium dateFormatter.timeStyle = .medium Expected output: Aug 13, 2017 6:04:11 PM Current outp...
Noeminoesis asked 13/8, 2017 at 16:12
1

© 2022 - 2024 — McMap. All rights reserved.