toUTCString -- parse the parts of the date

I was trying to convert my date to GMT and then get each individual date part but it won't let me use the normal getMonth, getDate, etc--I'm guessing because it converted the date to a string?   How can I get the individual parts of the date like my code below the following 2 lines?   The date has to be in GMT.

dteDate = new Date();
dteDate = dteDate.toUTCString();


// this is how i originally broke the date apart before converting to GMT      
var dteMonth = dteDate.getMonth() + 1;
var dteDay = dteDate.getDate();
var dteYear = dteDate.getYear();
var dteHours = dteDate.getHours();
var dteMin = dteDate.getMinutes();
var dteSec = dteDate.getSeconds();
saturationAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
0
 
leakim971PluritechnicianCommented:
dteDate = new Date();
dteDate = formatDate(d);

Open in new window

0
 
leakim971PluritechnicianCommented:
oups
dteDate = new Date();
dteDate = formatDate(dteDate);

Open in new window

0
 
saturationAuthor Commented:
Perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.