Getting "undefined" when trying to use getMonth on date acquired via AJaX
I'm trying to implement a script that will display both the user's local time and the time in St. Louis (based off of the server clock; I want to convert it to UTC, then subtract the hours based upon DST, either -5 or -6.) But I'm hitting a slight snag.
As far as the local time, that's a two-inch putt. I'm grabbing the datetime from the user's computer, and manually formatting it to look like:
Your Time: Friday, December 16, 2011 - 08:35:00 PM
I'm using AJaX to get the time from the server using return xmlHttp.getResponseHeader("Date"); and the hours, minutes, and seconds are fine, as is the year. But when I try to use getMonth() and getDay(), the values are coming back as "undefined". I'm assuming because they are expecting integers, but receiving text.
So, how can I retrieve the month and day-of-week from my AJaX?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread