xcode


I want convert from string to date


NSDate *LastBuildDate;
NSDate *PubDate;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:#"yyyyMMddhhmmss"];
LastBuildDate = [formatter dateFromString:buttoninfoamtion.mLastdate];
PubDate=[formatter dateFromString:newsItem.mPubDate];
if([PubDate compare:LastBuildDate])
buttoninfomation.mlastdate and newsItem.mPubDate is string from OpenAPI
ex)
buttoninfomation.mlastdate: Tue, 18 Oct 2011 15:54:43 +0900
newspub:Tue, 18 Oct 2011 15:58:00 +0900
but
LastBuidDate = (null)
PubDate = (null)
I want to compare two factor .
So date- date or string- string but I think string - string is so complex.
what wrong up codes?
Well the format you've given of "yyyyMMddhhmmss" doesn't match "Tue, 18 Oct 2011 15:54:43 +0900" even slightly.
Try
EEE, dd MMM yyyy HH:mm:ss Z
as the format string - see the iOS documentation and the Unix TR#35 for more information.

Related Links

Xcode 8 upgrade errors
Is it possible to view source code WITHOUT rendering markdown in a .xcplaygroundpage?
xcode change output of console information [duplicate]
productbuild - Resources not copying
Copy the complete content of general NSPasteboard
XCode XCAssets and autocompletion
Xcode Folder references > missing files
How do you auto build custom included frameworks or “kits” in Xcode?
resubmitting to App Store, should I increase version number or build in xcode?
Code Signature Invalid
I can no longer comment code using Xcode 8.0
Stack guard causing crash C++ Memory allocation of Vector
How to find object by debug - address in xcode
Unable to boot simulator xcode 7.3.1 / OS 10.11.6
xcodebuild pass arguments to application on iOS
iMessage sticker app size export in xcode

Categories

HOME
events
functional-programming
barcode-scanner
kendo-dropdown
scroll
mousemove
tcsh
message-queue
loopbackjs
liferay-7
lvm
ipv6
linker
supercollider
angular-meteor
onvif
phpseclib
telegraf
scheduler
eddystone
stack-overflow
angular4
outlook-restapi
google-cloud-logging
spam
wsf
web-analytics
managed-c++
tortoisemerge
code-climate
guice
es6-modules
instructions
vcenter
publishing
delayed-job
rust-cargo
nsmutablearray
quickcheck
uivisualeffectview
widestring
reset
sbjson
morphline
webalizer
deployd
supertest
hibernate-ogm
node-apn
nslayoutconstraint
emf-compare
pbx
jsonix
dmarc
dojo-build
noclassdeffounderror
fdt
distributed-cache
gravatar
cortana
godeps
ibm-was
arbre
mixins
search-form
kotlin-android-extensions
deque
subfolder
nssortdescriptor
signed
incron
phonegap-facebook-plugin
password-recovery
iodocs
berkeley-db-xml
tabris
rails-api
sql-function
pre
visual-c++-2005
xsd2code
yii-booster
jquery-transit
sly-scroller
session-0-isolation
kobold2d
hardcode
suphp
solandra
outlook-2007-addin
3270
projectpier
data-retrieval
fuzzy-comparison
downloadfile
account-management

Resources

Encrypt Message