Search code examples
phpswiftnsdatealamofire

How do I convert Swift date and TimeInterval so that I can send to php server?


I have a swift date and timeInterval that I want to send to php server via Alamofire. What should I do to these variables in order to send either via JSON or param?

Is there a specific format I should use?

( I do not know how the interaction between those two work)


Solution

  • If you want to save your db with php or etc. , you can use datetime format. You can send string to db ' also It recognize the string and save as date format to db. Your format can be "yyyy-MM-dd'T'HH:mm:ssZ"