You can use ISO8601DateFormatter
class in Swift to convert a string in %y-%m-%dt%h:%m:%s.%fz
format to date object.
Here's an example code snippet:
main.swift325 chars11 lines
This will output the date object in ISO format.
You can customize the format options based on your requirement.
Note: In Python %y
is Year without century as a zero-padded decimal number and %Y
is Year with century as a decimal number. So, you may need to adjust the format string accordingly.
gistlibby LogSnag