2011-08-06T12:29:10.703+05:30
i have following date that i have convert in this format like
"2011-08-06T12:29:10+05:30"
Here is a nice blog to have a better idea...
A more better explain is on this link
You can see that you need more than one date NSDateFormater for this job
Related
I need to recover date from mongodb iso date formate by angular js. How can I recover this? please help me.
Mongodb iso date: 2013-12-28T08:30:17.795Z
My convert type: 28-12-2013 8:30:17
Maybe something like:
var date = new Date("2013-12-28T08:30:17.795Z");
$scope.displayDate = date.toLocaleString();
I really recommend http://momentjs.com/. they have a good format function.
Ex.
moment('2013-12-28T08:30:17.795Z').format('DD-MM-YYYY HH:mm:ss');
Will give the answer
28-12-2013 08:30:17
Its very easy to get the time as per mongo,
get the value in your controller from the mongoDB.
Use that value to store in the variable.
Convert it to the ISO format easily using .toISOString() method and its done.
Here is sample..
getdate.controller(..){
$scope.fromdate=date.toISOString();
console.log($scope.fromdate);
}
Now you can get in the MongoDB format..
i want to create different methods related NSDate , eg, datedifference,date to seconds,
date comparision, date format conversion .can any one give me code or link related thos methods if available.
You should have a look to this and this
You can follow this link1 link2.
Hope it helps.
Am getting date (10/02/2011) in xmlresponse how to get this value in to string using NSXmlParserDelegate. "/" blocks me and am not getting how to handle this..
Thanks in advance..
Use NSDateFormatter to get date from NSString from any formats.
You have not been clear where this xml data is coming from, I couldnt turn anything up on how dates should be formatted in xml. The first thought is "you are doing it wrong" if you can try using a different separator for dates, parse them out of the stream before you give the data to NSXMLParser. I know which I would prefer.
I am exporting a date value from sqlite and placing it into an email. The date appears like this
279498721.322872
I am using Objective C in an Iphone App. Does anyone know how to make this export out as a regular date whether it is all number like
2009-02-10 or anything legible?
Well, if you take the number 279498721.322872 and throw it into an NSDate object using +dateWithTimeIntervalSinceReferenceDate, you get (here in the MDT timezone): 2009-11-09 15:32:01 -0700, which was just under 4 hours ago. If that's the time you're expecting, then formatting it is as simple as using an NSDateFormatter.
However, the thing to notice is that sqlite (by default) stores dates as textual representations (unless you specify differently in the sql statement). So the real question here is "where are you getting that number from?"
echo date("Y-m-d",time(279498721.322872));
Thanks for the responses. The answer came from my Guru Alex Cone. He told me to use the following:
NSTimeInterval tempInterval = (NSTimeInterval)sqlite3_column_double(statement, 4);
The tempInterval variable can then be loaded into the the NSDate method.
I would like to format a J2ME Date object to only show the date part, not the date and time. What would be the easiest way? Would probably need to include an external library to do this.
java.util.Calendar has all the methods required to format a date output.