date from string saving wrong date
ProfoundDonut opened this issue · comments
I'm saving a date, and then converting it to a string. It however displays a date from last year.
Here is my code:
let date = Date(fromString: dateval, format: .custom("MM/dd/YYYY"))
dateval
is downloaded from a server, and is equal to 12/21/2019
The output of
date.toString()
is 12/23/18, 12:00 AM
Thanks in advance for any help!
Word Why? My math
Max Simon <notifications@github.com> 于 2019年12月21日周六 10:35写道:
… Closed #93 <#93>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#93?email_source=notifications&email_token=AAYJHHTOMXSGCN7BWK2HVMDQZV6GZA5CNFSM4J6EYN5KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOVT76YPQ#event-2902453310>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYJHHUBUBLI2FUSPGWZBRTQZV6GZANCNFSM4J6EYN5A>
.