Select to view content in your preferred language

Did the date format change for Query, REST, Post, JSON responses at ags 10?

9103
11
01-04-2011 07:47 AM
KevinGooss
Regular Contributor
On my 9.3.1 server i get this response:

"ORIG_HRZ_COLL_DATE" : "1/5/2011 12:00:00 AM"

But on my 10 server i get this:

"ORIG_HRZ_COLL_DATE" : 1294185600000

Am I in error here or was there some fundamental change made in this area going from ags 9.3.1 to ags 10 or is it in the js api?
If yes, then is there a list of all changes like this somewhere? It's very frustrating to have to find them like easter eggs.
11 Replies
StephanieWidas
Occasional Contributor
We just upgraded our ArcGIS Server from 9.3 to 10.  We're now having that date issue described above. How is everyone handling this?  How do I fix my Flex widgets and JavaScript apps to display the date/time fields the way we're used to seeing them (mm/dd/yyy hh:mm:ss)?
Thanks,
Stephanie
0 Kudos
KevinGooss
Regular Contributor
I feel your pain. This was a large hassle. Don't know about flex but this was helpful for me in js:

    Date.prototype.toFormattedDateString = function () {
        return isNaN(this) ? 'NaN' :

            [
                _addLeadingZero(this.getUTCMonth() + 1),
                _addLeadingZero(this.getUTCDate()),
                this.getUTCFullYear()
            ].join('/');
    };

    Date.prototype.toFormattedDateTimeString = function () {
        return isNaN(this) ? 'NaN' :

            [
                _addLeadingZero(this.getUTCMonth() + 1),
                _addLeadingZero(this.getUTCDate()),
                this.getUTCFullYear()
            ].join('/') + " " + _addLeadingZero(this.getUTCHours()) + ":" + _addLeadingZero(this.getUTCMinutes()) + ":" + _addLeadingZero(this.getUTCSeconds());
    };
0 Kudos